Expand my Community achievements bar.

SOLVED

Using Profile script values in Offer

Avatar

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

Avatar

Correct answer by
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

Avatar

Correct answer by
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.