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?
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.
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 :
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?
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.
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.