- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
12-11-2015 07:54 AM
Hi!
Working our next web content personalization project - in this case, we want to take the top four categories visited most by a customer and use that to adjust four blocks of content on our page to display a quick link to their favorite categories.
I cannot figure out how to access the "Categories Viewed" tally, which I know has the data I want...
I feel like I want to grab that data, pull it out of the array into a string, and use that string to define "1st favorite category", "2nd favorite category", etc...then I can use that info to set badges and create extensions to change up my content. I just can't FIND it in the utag_data layer...
Any insights appreciated!! :)
Thank you!
Monique
Solved! Go to Solution.
12-11-2015 08:32 AM
Hi Monique,
Tallys are passed in the utag_data object. You'll see them referenced as "metric_sets" because that is what they were initially called.
Trait=Property
List=Property Set
Tally=Metric Set
Timeline=Sequence (this doesn't get passed to the data layer)
So you'll see the Tallys set in the utag_data object as:
va.metric_sets.attributeId.key=value
So if you have a Tally such as:
"Page Views":{
home:4,
tiq:1
}
and the attribute ID is 5122, you'll see them in the utag_data object as:
va.metric_sets.5122.home : 4
va.metric_sets.5122.tiq : 1
You'd access these in JS code with utag.data["va.metric_sets.5122.home"] and utag.data["va.metric_sets.5122.tiq"].
To get the attribute ID, go to TiQ>Data Layer and filter on "AudienceStream" attributes then expand the details of the attribute to be used. Or, if you're handy with developer tools, within AS, right-click on the attribute name, Inspect Element, and grab it from the "data-id" element.
I understand this doesn't give you the top 4 values, but it does give you access to the data and then you can build your logic appropriate to determine the top 4.
Does this help?
12-11-2015 09:57 AM
Thank you - that helps, I was confused by the "metric set" instead of "tally" showing up!
PS - I get the attribute ID from the URL when I click on the attribute. :)
Copyright All Rights Reserved © 2008-2023