Expand my Community achievements bar.

SOLVED

Counting Impressions on JSON offers for Frequency Capping

Avatar

Level 2

Ok - I would like to set some frequency capping on some experiences. I know this involves passing some kind of unique identifier of that experience, creating a profile script so it can be counted and then creating an audience depending on my how many times I'd like customers to see the experience. 

We use JSON offers and I'm struggling with Step 1. How to I pass a unique identifier for the experience? Can I create a unique mbox through JSON and count that? 

 

Thanks for any help.

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi @JonathanBa1 , 

You correctly mentioned that for frequency capping, you'll need to pass some unique identifier or trigger an mbox impression which can be used in profile script to count/increase the value of number of times the experience is viewed. 

In this scenario, while using JSON in your experience, I think it would be better to pass a unique identifier at the point where you are fetching the Adobe target JSON response. 

For example, Let's assume you want to fetch the activity JSON in your homepage , once you receive the correct JSON response from the activity , you can trigger the given track event code in your homepage code : 

adobe.target.trackEvent({
 "mbox": "experience-experience_interaction",
 "params": {
"experience_id": "your_experience_identifier"
  }
 });


And you can create a profile script to check the number of impressions. For example as given in the code below : 

// Profile script code for AT.js
// Step 1: get the existing value stored in the profile script
// if the value does not exist, then set the profile-script value to 0
var countat = user.get('your_profile_script_name')||0;
// Step 2: check that this call is result of an interaction with your experiences
// by checking the name of the mbox and mbox=parameter containing experience-identifier
if(mbox.name == "experience_interaction" && mbox.param("experience_id") == "your_experience_identifier") {
// if its an interactiion with your experience then increase the profile-script value by 1
	countat = countat + 1;
}
return countat;


You can go through a similar article on frequency capping for reference : 
https://dexata.co/art-of-balance-overcoming-marketing-fatigue-using-frequency-capping/ 

I hope you find it helpful.

Best Regards,
Vaibhav Mathur 


View solution in original post

4 Replies

Avatar

Correct answer by
Level 7

Hi @JonathanBa1 , 

You correctly mentioned that for frequency capping, you'll need to pass some unique identifier or trigger an mbox impression which can be used in profile script to count/increase the value of number of times the experience is viewed. 

In this scenario, while using JSON in your experience, I think it would be better to pass a unique identifier at the point where you are fetching the Adobe target JSON response. 

For example, Let's assume you want to fetch the activity JSON in your homepage , once you receive the correct JSON response from the activity , you can trigger the given track event code in your homepage code : 

adobe.target.trackEvent({
 "mbox": "experience-experience_interaction",
 "params": {
"experience_id": "your_experience_identifier"
  }
 });


And you can create a profile script to check the number of impressions. For example as given in the code below : 

// Profile script code for AT.js
// Step 1: get the existing value stored in the profile script
// if the value does not exist, then set the profile-script value to 0
var countat = user.get('your_profile_script_name')||0;
// Step 2: check that this call is result of an interaction with your experiences
// by checking the name of the mbox and mbox=parameter containing experience-identifier
if(mbox.name == "experience_interaction" && mbox.param("experience_id") == "your_experience_identifier") {
// if its an interactiion with your experience then increase the profile-script value by 1
	countat = countat + 1;
}
return countat;


You can go through a similar article on frequency capping for reference : 
https://dexata.co/art-of-balance-overcoming-marketing-fatigue-using-frequency-capping/ 

I hope you find it helpful.

Best Regards,
Vaibhav Mathur 


Avatar

Level 2

Thanks, but I need some clarity on the first step where you said "once you receive the correct JSON response from the activity , you can trigger the given track event code in your homepage code". 

Can I create the unique experience identifier in the JSON offer code? 

 

I'm pretty clear on the profile script step and audience step, but I just need help with the identifier. Thanks.

Avatar

Level 7

Hi @JonathanBa1 ,

 

I do not think that you would be able to pass the experience identifier inside the activity while using JSON.

 

A better place for passing the experience identifier would be in the backend where you're placing the code to fetch the adobe target offer.

 

For example,

If you are fetching the JSON offer in your backend code using getOffer/applyOffer, you can place an if condition, where if the response is the correct JSON as expected, you can trigger adobe.target.trackEvent script as an experience identifier in the backend page itself.

 

I hope you find it helpful.

 

Best Regards,

Vaibhav Mathur

Avatar

Community Advisor

You should be able to set up a profile script based on the response tokens within the Target response:

 

https://experienceleague.adobe.com/en/docs/target/using/administer/response-tokens

 

Once you get your initial Target response, read the tokens for activity id/experience id and fire off another Target call (trackEvent) with any params that will increment the profile script. 

 

https://experienceleague.adobe.com/en/docs/target/using/audiences/visitor-profiles/profile-parameter...