I'm trying to work with user profile data (category affinity specifically) to implement a custom solution. I'm wondering if it's possible to read that data using JavaScript rather than using Target's built-in category affinity options. I can see this data in the mbox JSON file that's being loaded on our site if I enable the Target trace, but I haven't found a way to access that data programmatically.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @amberb67455123,
Are you trying to get a visitor's category affinity value back to the page so you can run some client-side JS with it? If that is what you are trying to do you can create a custom modification offer in the VEC that writes a script back to the page and sets the category affinity value to some JS variable. To write Target profile values into experience content/offers see this help doc: https://experienceleague.adobe.com/docs/target/using/experiences/offers/passing-profile-attributes-t.... I think the way to pass category affinity would be with: ${user.endpoint.categoryAffinity}. So you could create a custom modification like this:
<script>var catAff = "${user.endpoint.categoryAffinity}";</script>
And then your client-side JS could reference the catAff value as needed.
hello,
plz refer - https://experienceleague.adobe.com/docs/target/using/audiences/visitor-profiles/variables-profiles-p...
also refer this post for more details
Hi @amberb67455123,
Are you trying to get a visitor's category affinity value back to the page so you can run some client-side JS with it? If that is what you are trying to do you can create a custom modification offer in the VEC that writes a script back to the page and sets the category affinity value to some JS variable. To write Target profile values into experience content/offers see this help doc: https://experienceleague.adobe.com/docs/target/using/experiences/offers/passing-profile-attributes-t.... I think the way to pass category affinity would be with: ${user.endpoint.categoryAffinity}. So you could create a custom modification like this:
<script>var catAff = "${user.endpoint.categoryAffinity}";</script>
And then your client-side JS could reference the catAff value as needed.
Views
Replies
Total Likes
Ah...so AT: Failed actions often means there is an error in the JS. Reviewing my sample above I see the error. I didn't put quotes around the category affinity. I've correct the original response.
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Like
Replies
Views
Likes
Replies