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

Using Profile script values in Offer

RasmusFriis
Level 1
Level 1

Hello Community

Please help me, I have a question to Adobe Target.

I want to use profile script values in my offers, so what I can get and set the values when a user perform a certain action, such as pressing a button on a popup, which I plan to show in my offer.

I already know that I can get the mBox values to be used in my javascript code, but I can't really find any functions, that will set & get my user profile script values.

This is how I get the values to be shown in a certain html offer.

<p>Profile Test value: <span id="test_value" class="newtext1">${user.profile_test1}</span></p>

then I can use it in my javascript offer like this:

var value = $('#test_value').text();

but I can't reach the 'test_value' in the profile script. Could someone please shown me an example or send me some links to how to use it the right way ?

Greetings from Rasmus Friis, Denmark

1 Accepted Solution
akashj80621328
Correct answer by
Level 2
Level 2

Thanks for reaching out to Adobe community.

You could fire an mboxUpdate call immediately when user performs the action. Send user's action as profile parameter in the call.
For ex. mboxUpdate('target-global-mbox', 'profile.clicked=yes'); 

Then create a profile script with code return profile.get('clicked'); 

Use the profile script in offer as ${user.<profile_script_name>}

Note : With this approach 

    1. For new user, the value is initially empty. As soon as user takes action, profile script contains the value of action taken.

    2. For returning user, last selected value Is pre populated in script.

View solution in original post

1 Reply
akashj80621328
Correct answer by
Level 2
Level 2

Thanks for reaching out to Adobe community.

You could fire an mboxUpdate call immediately when user performs the action. Send user's action as profile parameter in the call.
For ex. mboxUpdate('target-global-mbox', 'profile.clicked=yes'); 

Then create a profile script with code return profile.get('clicked'); 

Use the profile script in offer as ${user.<profile_script_name>}

Note : With this approach 

    1. For new user, the value is initially empty. As soon as user takes action, profile script contains the value of action taken.

    2. For returning user, last selected value Is pre populated in script.

View solution in original post