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

Is it possible to access mbox / user profile data through JavaScript?

Avatar

Avatar
Validate 1
Level 1
amberb67455123
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
amberb67455123
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
amberb67455123
Level 1

12-05-2021

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.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 25
Employee
ryanr701
Employee

Likes

197 likes

Total Posts

219 posts

Correct Reply

87 solutions
Top badges earned
Give Back 25
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Give Back 25
Employee
ryanr701
Employee

Likes

197 likes

Total Posts

219 posts

Correct Reply

87 solutions
Top badges earned
Give Back 25
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
ryanr701
Employee

17-05-2021

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.

Answers (1)

Answers (1)

Avatar

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

120 likes

Total Posts

192 posts

Correct Reply

77 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Boost 100
Level 7
rush_pawan
Level 7

Likes

120 likes

Total Posts

192 posts

Correct Reply

77 solutions
Top badges earned
Boost 100
Validate 1
Ignite 1
Give Back 5
Give Back 3
View profile
rush_pawan
Level 7

13-05-2021