Expand my Community achievements bar.

SOLVED

Are page-load variables sent along with event-based variables in DTM?

Avatar

Level 2

I've got a few props and evars that I set on page load for all pages on my site. If I create an event-based rule, do I need to set those variables again? It seems like they're being set already. Also, does this have any affect on pathing?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Joel, 

Yes , props get sent when the event based rule triggers them by just mentioning them in S.linkTrackVars variable in custom page code .If the variable is set on a page load rule it is not required to set it again on event based rule and the only thing that needs to be done is to mention them in S.linkTrackVars variable . Please write the above code (Code mentioned in last reply) in the custom page code section of Event based rule in DTM. 

 

Thanks & Regards

Parit Mittal

View solution in original post

6 Replies

Avatar

Level 10

Hi Joel, 

There is no need to set these variables again in the event based rule, The only thing that needs to be done is to include the variable in the s.linktrackVars string to signify the variable that needs to be tracked in an event based rule. Please see the below example for more reference.

s.linkTrackVars = 'prop7,prop5'; s.linkTrackEvents = 'None'; s.prop7 = "GlobalHeader:"+ $(this).text();

As per the above code, Prop5 is set on the page load and the value  is again sent in the image request for Event based rule.

Also, it does effect pathing  as pathing basically signifies the sequence in which values are being set to a prop.

Thanks & Regards

Parit Mittal

Avatar

Level 2

Hey Parit,

Thanks for the reply! I've been using DTM rules to manage those variables. Am I better off just writing the code like you've provided versus using DTM to manage everything? Not sure if the same rules apply when using DTM rules?

When using DTM, the event-based rule section doesn't allow me to reference variables that are set in the page load section. I can either use "Set as" or "Duplicate from".

When I use the debugger, I do see that all the variables are set correctly. My question can be best summarized by asking, do these props get sent when the event based rule triggers despite not having them set in the event-based rule section in DTM?

I'm 100% OK with manually coding these things, but I was hoping that I could leverage DTM to make things easier to manage.

 

Best,

Joel

Avatar

Correct answer by
Level 10

Hi Joel, 

Yes , props get sent when the event based rule triggers them by just mentioning them in S.linkTrackVars variable in custom page code .If the variable is set on a page load rule it is not required to set it again on event based rule and the only thing that needs to be done is to mention them in S.linkTrackVars variable . Please write the above code (Code mentioned in last reply) in the custom page code section of Event based rule in DTM. 

 

Thanks & Regards

Parit Mittal

Avatar

Employee Advisor

Hi Joe, you'll probably want to use data elements to capture those values. Then instead of trying to grab prop/eVar values from the page load you, everything can be referenced from the data element. You can read up more on data elements here: https://marketing.adobe.com/resources/help/en_US/dtm/data_elements.html

Avatar

Level 2

Thanks for the reply!

That sounds quite practical. So, just to confirm, when an event-based rule fires (using DTM) sends a success event, any props/eVars that were set on the page load are not sent along with it and I'll need to re-reference them using the data elements?

For a concrete example - let's say a user clicked a banner and I store the banner name in eVar4. Next, the user proceeds to purchase an item and I have an event-based rule that fires the "purchase" event after checkout...in order for that evar4 to be attributed to the success event, I'd want to reference it again in the event-based rule?

Avatar

Level 10

Hi , 

When an eVar is set to a value for a visitor, the value is remembered until it expires. Any success events that a visitor encounters while the eVar value is active are counted toward the eVar value.

Hence in your use case,  there is no need to reference them again in the event based rule, evar4 will be attributed to the success event. For more details about the conversion variable please see the following link : 

https://marketing.adobe.com/resources/help/en_US/sc/implement/eVarN.html

Thanks & Regards

Parit Mittal