Hi,
I am creating cookie banner and I would like to divide users on two groups based on the button which they clicked. How would you approach that tasks? Set up event listener for the buttons and then set some profile attributes? Can I add this in the experience script? How would you approach that?
Topics help categorize Community content and increase your ability to discover relevant content.
Hi @Michael_Soprano - before we go into the technical solution, let me try to understand the expected behaviour when a customer clicks "Decline". Will such customers be excluded from showing any personalised experience, including AB tests? In other words, will they be part of any experience driven by Adobe Target?
If the answer is yes, then recommended approach should be to block Adobe Target call altogether using your Tag Management System. The idea should be to respect customer's choice.
However, if its only limited to Personalisation but not AB tests (would suggest confirming this with your company's DPO - Data Protection Officer) then here's the solution:
1. Pass a flag corresponding to which button customer clicked as an mbox-parameter through trackEvent() method, by adding following code to buttons' event-listener:
adobe.target.trackEvent({
"mbox": "track_customer_preference",
"params": {
"preference": "accepted" //or declined
}
});
2. Create a profile-script using this parameter
if(mbox.name == "track_customer_preference" && mbox.param("preference")) {
return mbox.param("preference"); // will return either "accepted" or "declined"
}
3. Use the profile-attribute in your activities as audiences.
Hope it helps,
Regards
Rajneesh
Thanks a lot.
Hi @Michael_Soprano - before we go into the technical solution, let me try to understand the expected behaviour when a customer clicks "Decline". Will such customers be excluded from showing any personalised experience, including AB tests? In other words, will they be part of any experience driven by Adobe Target?
It is for the demo purposes so it does not matter yet a lot but it is definetely food for thought for me and I will also prepare this scenario in my list of use-cases.
1. Pass a flag corresponding to which button customer clicked as an mbox-parameter through trackEvent() method, by adding following code to buttons' event-listener:
I implemented code like this:
It looks like adobe global function is not available. How to resolve this bug?
Views
Like
Replies