Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

How to get the favorite category of a user profile?

hegi90
Level 2
Level 2

Is it possible to access the currently favorite category (category affinity) of a user? I need this information either in the datalayer or for persistance in the localStorage, are there any possibilities, may through API Calls?

 

Regards

Patrick

1 Accepted Solution
gaureshk3014423
Correct answer by
Level 8
Level 8

The category affinity feature in Adobe target automatically captures the categories a user visits and then calculates the user's affinity for the category so it can be targeted and segmented on. This helps to ensure that content is targeted to visitors who are most likely to act on that information.

Following document may help you understand more

 

https://docs.adobe.com/content/help/en/target/using/audiences/visitor-profiles/category-affinity.htm...

 

View solution in original post

7 Replies
gaureshk3014423
Correct answer by
Level 8
Level 8

The category affinity feature in Adobe target automatically captures the categories a user visits and then calculates the user's affinity for the category so it can be targeted and segmented on. This helps to ensure that content is targeted to visitors who are most likely to act on that information.

Following document may help you understand more

 

https://docs.adobe.com/content/help/en/target/using/audiences/visitor-profiles/category-affinity.htm...

 

View solution in original post

hegi90
Level 2
Level 2

Hi, i'm aware of what category affinity is and how it is calculated. Sure, mostly we use it via Target and display e.g. the favorite articel to a user. But is it possible to get this information out of Adobe Target, e.g. like an API Call to have this information in the datalayer, do some more stuff?

gaureshk3014423
Level 8
Level 8
Yes, i guess user category affinity is passed in response tokens you'll need to do some JavaScript code to read response tokens and push those values into datalayer.. your developer would help you better with reading adobe target response tokens and pushing it into datalayer
hegi90
Level 2
Level 2
That's it :). Thanks for pointing me to the respone token, works perfectly 🙂
hegi90
Level 2
Level 2

For those who are interessted in the solution, I used following script:

 

document.addEventListener(adobe.target.event.REQUEST_SUCCEEDED, function(e) { 
  console.log("Request succeeded", e.detail); 
  var tokens = e.detail.responseTokens[0];
  console.log(tokens["profile.categoryAffinity"]);
});

And then instead of logging it, persist it to localStorage or dataLayer 

gaureshk3014423
Level 8
Level 8

hey,

I tried running this same code in console but not sure why it's not working for me

do i need to make any changes before trying to run it in console?

gaureshk3014423_0-1579506817755.png