Expand my Community achievements bar.

SOLVED

Tracking Custom Event on the Target banner using Data Elements & Rules

Avatar

Level 8

Hi, 

 

I implemented AEP and Target using AEP Data Collection Web SDK. I implemented cookie banner using Target with 2 buttons which generate two custom events on click: 

a) accept button - acceptedPersonalization

b) decline button - refusedPersonalization 

However there is a problem. I am not able to catch if these buttons were clicked using Data Elements. I implemented Data Element custom code in order to track that event. But that data elements returns nothing (for example when I use 

_satellite.getVar('myDataElement')). Imho it might be connected with order of loading data elements etc. However if I use Rules and Custom Event in that rule AEP catches that Custom Event. However if I want to pass that data to XDM Schema I need to have data element 

 

So there are two 2 questions: 

1. Is it possible to track Custom Event with Data Element which might be fired on click (ex. 10 seconds later - when some element was clicked by user)? Additionally the Custom Event is implemented on the banner which was injected using Target. 
2. Is it possible to generate Data Element after Rule was fired ? 

Michael_Soprano_0-1703010614451.png

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi @Michael_Soprano,

I would need some more details about you target activity, launch rules, data elements and AEP audiences to understand the problem.

If I were to implement such solution, I would have the following setup:

Cookie Banner Activity on Target
Events on button click:

a) accept button - acceptedPersonalization
b) decline button - refusedPersonalization
Audience: Where acceptedPersonalizationCookie exists

 

Rules on Launch:
1) When acceptedPersonalization event is trigerred then set acceptedPersonalizationCookie to true
2) When refusedPersonalization event is trigerred then set acceptedPersonalizationCookie to false
3) When page loaded if acceptedPersonalizationCookie is true then show Personalization else no Personalization.

In this case you need only one data element which captures the value of acceptedPersonalizationCookie cookie, which can then be used in your XDM schema data variable.

To answer your questions:

1. Is it possible to track Custom Event with Data Element which might be fired on click (ex. 10 seconds later - when some element was clicked by user)? Additionally, the Custom Event is implemented on the banner which was injected using Target. 

 

Response: Yes, you can add delay in your actions. Let's say you have a rule configured on click of an element, you can then define the first action as a Custom Code action which basically does nothing, but you add a timeout of 10000 milliseconds under Advanced Options

VikasChaudhary__1-1704263381267.png

and then add your action that you want to perform, so you rule would look like:

VikasChaudhary__0-1704263332912.png


2. Is it possible to generate Data Element after Rule was fired?
Response: The data elements are like dynamic JavaScript statement, which gets executed every time they are referenced, the values are not persisted.

-Vikas Chaudhary

View solution in original post

1 Reply

Avatar

Correct answer by
Level 3

Hi @Michael_Soprano,

I would need some more details about you target activity, launch rules, data elements and AEP audiences to understand the problem.

If I were to implement such solution, I would have the following setup:

Cookie Banner Activity on Target
Events on button click:

a) accept button - acceptedPersonalization
b) decline button - refusedPersonalization
Audience: Where acceptedPersonalizationCookie exists

 

Rules on Launch:
1) When acceptedPersonalization event is trigerred then set acceptedPersonalizationCookie to true
2) When refusedPersonalization event is trigerred then set acceptedPersonalizationCookie to false
3) When page loaded if acceptedPersonalizationCookie is true then show Personalization else no Personalization.

In this case you need only one data element which captures the value of acceptedPersonalizationCookie cookie, which can then be used in your XDM schema data variable.

To answer your questions:

1. Is it possible to track Custom Event with Data Element which might be fired on click (ex. 10 seconds later - when some element was clicked by user)? Additionally, the Custom Event is implemented on the banner which was injected using Target. 

 

Response: Yes, you can add delay in your actions. Let's say you have a rule configured on click of an element, you can then define the first action as a Custom Code action which basically does nothing, but you add a timeout of 10000 milliseconds under Advanced Options

VikasChaudhary__1-1704263381267.png

and then add your action that you want to perform, so you rule would look like:

VikasChaudhary__0-1704263332912.png


2. Is it possible to generate Data Element after Rule was fired?
Response: The data elements are like dynamic JavaScript statement, which gets executed every time they are referenced, the values are not persisted.

-Vikas Chaudhary