Skip to main content
Level 2
Jul 14, 2020 7:43 PM UTC
Solved

Use Response Token inside Profile Script

Hello, I would like to be able to use response token data inside a profile script. 

 

My task is to use "activity.name" as a profile script value so that I can count the amount of time this activity was seen and apply frequency capping.

 

for example, if activity views are < x, display activity, otherwise don't.

 

return activity.name;

 

simply using this is not returning anything.

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ryanr7Accepted solution
Adobe Employee
Jul 14, 2020 11:05 PM UTC

Response tokens are not available for profile scripts. Profile scripts run before response tokens are generated. However, to achieve your use case, one option I can think of would be including a trackEvent in your activity to trigger a second call back to Target to tell a profile script an activity view happened. For example, you could add this trackEvent to your experiences as a custom modification:

 

<script> adobe.target.trackEvent({"mbox":"activityViewNotify", "params":{"activityName":"${activity.name}"}}); </script>

 

Then you could have the profile script look for the activityViewNotify mbox and the value of the activityName parameter to determine the count.

Note the ${activity.name} token is not a response token but has the same value. It's dynamic data in an offer as used here.

5 replies

ryanr7Adobe EmployeeAccepted solution
Adobe Employee
Jul 14, 2020 11:05 PM UTC

Response tokens are not available for profile scripts. Profile scripts run before response tokens are generated. However, to achieve your use case, one option I can think of would be including a trackEvent in your activity to trigger a second call back to Target to tell a profile script an activity view happened. For example, you could add this trackEvent to your experiences as a custom modification:

 

<script> adobe.target.trackEvent({"mbox":"activityViewNotify", "params":{"activityName":"${activity.name}"}}); </script>

 

Then you could have the profile script look for the activityViewNotify mbox and the value of the activityName parameter to determine the count.

Note the ${activity.name} token is not a response token but has the same value. It's dynamic data in an offer as used here.

Translate
ambikaTewari_ATCI
Community Advisor
Community Advisor
Jul 15, 2020 11:06 AM UTC
Hi @21485 tried this approach for one of my usecases , this works fantastically!
Translate