[AAE] Have Adobe Analytics Global Variables fire on all AA rules | Community
Skip to main content
Jennifer_Kunz
New Participant
August 21, 2018
Approved

[AAE] Have Adobe Analytics Global Variables fire on all AA rules

  • August 21, 2018
  • 23 replies
  • 36737 views

The variables set in the Analytics extension's Global Variables seem to not fire on all rules/rule types (see Global Variables - Direct Call Rule ). This is similar to how it was in DTM.

It would be great if we had some control over this (maybe give me the ability to say "fire for all beacons" or "fire for all s.t beacons" or "fire immediately before any beacon, but after other rules" or something), or by default they DID fire anywhere the Analytics Extension was in a rule. Otherwise, folks still have to resort to using doPlugins, or setting up a rule for global variables that somehow fires on all other AA rules/beacons.

23 replies

Jennifer_Kunz
New Participant
May 25, 2021

Thanks for that- that makes sense. I've come to expect data elements to always (re)evaluate at the time my rules run, but it sounds like since we're using the data element in a configuration component, the data element will only evaluate when that extension configuration component runs.
So it's bigger than just the Adobe Analytics Extension- I'd imagine many extensions that allow for dynamic data elements in the extension configuration could have this same problem (it's just not that often that we'd be expecting different dynamic values... though with the rise in SPAs, I suspect that will increase). 

yuhuisg
New Participant
May 25, 2021

@jennifer_kunz it turns out that my assumption about how Adobe Analytics defines "Global variables" is wrong. It actually has to do with how Launch evaluates data elements. See Web properties: Data Elements' runtime evaluation cannot handle dynamic data element values · Issue #125 · adobe/reactor-turbine (github.com).

Jennifer_Kunz
New Participant
May 21, 2021

Ah, fair, it appears it will set on s.tl beacons if you don't ever use Clear Variables; I should have caught that in my little demo site. I guess the key difference is that I do count on dynamic values (especially on single page apps), and I do use the Clear Variables action (especially on single page apps), and I like keeping all "global-ish" variables all in one place, so you can set it up once and forget it and not worry about which fires on which beacon, so I'm clearly not the target audience for this functionality:).  

But it's come up enough for my clients that it feels like something needs to change- often enough that I've learned as soon as we start troubleshooting a variable not behaving as the client expects, I should ask if they're setting anything as global variables. 

But I appreciate you helping me think through how they can be used.

yuhuisg
New Participant
May 21, 2021

@jennifer_kunz I'm not able to replicate your experience. In my Launch properties, global variables are set with every beacon call with the same variables and values, both pageview s.t() and custom/download/exit links s.tl(). I don't use clearVars() nor "dynamic" values in data elements (i.e. for all intents and purposes, the data elements always have the same values for the lifetime of the page). clearVars() would, correctly, unset all variables, including global ones.

The nomenclature could be better, or maybe a description stating how global variables are set in the context of Launch rules and beacons.

Jennifer_Kunz
New Participant
May 21, 2021

I see what you're saying, but... they're not tracked with every beacon. They're never tracked on s.tl beacons, and if you ever clear out variables (as is best practice) then they're not tracked on that DOM ever again. I think calling them "global" is very misleading, because they really are just "global, once for each DOM load". 

Which I really wouldn't mind if there were some other way (other than doplugins) to have a set of variables that truly fire on every beacon.

yuhuisg
New Participant
May 21, 2021

@jennifer_kunz playing devil's advocate:

As the name implies, "Global variables" are variables that are tracked with every beacon. And Adobe's interpretation of "global" probably also means to track those same variables with the same values in every beacon.

If a variable were to have a different value, it would be because there are certain expected conditions that result in the new value. So the "Launch-y" way of doing things is to have a Rule for such expected conditions, and that Rule has a Set Variables action to set that same variable with the new value.

So in your example, you can set eVar15 with a default "not logged in" value in the extension's "Global variables" section. But your Rule gets triggered by the user's login, then your Rule should have a "Set Variables" action to update eVar15 with "logged in".

Jennifer_Kunz
New Participant
May 20, 2021

FWIW, this question came up again and I just retested, and it really is problematic as it is. Take a look at https://digitaldatatactics.com/test/testGlobalVars.html, which walks through the problems, which essentially boils down to:

  1. Global Variables only evaluate once, on page view, which is bad if you use clearVars, and particularly bad on a single page app.
  2. Global Variables don't get added to linkTrackVars and won't appear in any s.tl beacons.

I have plenty of workarounds, all of which basically come down to "don't count on Global Variables". Which means for something that I want on EVERY beacon, I either set it in doPlugins (making sure it's added to linkTrackVars), or I make sure every beacon has at least one rule that sets eVar15, potentially making either one rule with dozens of triggers, or dozens of rules that all set eVar15. 

 

PratheepArunRaj
New Participant
September 24, 2020

Sorry, Have you ever tried s.manageVars() function where it will not clear all the variables but only the selected ones?

New Participant
September 24, 2020

This feature removes like 500 lines of custom code in my implementations. Let's get it done. 

Jennifer_Kunz
New Participant
August 18, 2020

After testing, I can confirm- the global variables only fire on s.t beacons. They may hang around until an s.tl beacon, but they're not freshly set for s.tl beacons. If you fire clearvars after a page view, you will not have the global variables on subsequent s.tl beacons.