Expand my Community achievements bar.

SOLVED

With an Adobe Analytics rule, is it necessary to add a condition to check that 's' is defined?

Avatar

Level 2

Hi everyone!

Haven't used Launch... or Tags... or Platform Data Collection in a while, and just wondered when you set up an Adobe Analytics rule, should you add a condition to make sure the 's' variable is available?

I'm using the Adobe Analytics extension, and in the past didn't perform this check as I thought it was something baked into using the Adobe Analytics extension.

Many thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 4

The answer is ... it depends. Inside of Adobe launch, if you are creating rules or custom conditions - The s variable will be scoped in and available to use. So no need to declare it, Adobe Launch + the Analytics extension takes care of that for you.

 

If you want to use the "s" variable elsewhere, there is an option in the Launch extension to enable the s variable to be globally accessible. This comes in handle when you have a generic helper method (such as a plugin) that assumes the s variable (is global) instead of allowing the s variable to be passed as a variable(preferred)

View solution in original post

5 Replies

Avatar

Level 5

first check Jquery plugin is running before the adobe launch & cross-validate that the launch script is inserted in the head tag section

 

https://experienceleague.adobe.com/docs/analytics/implementation/vars/functions/doplugins.html?lang=...

 

Update the setting in the adobe analytics plugin and as well publish the configurations.

Adobe Analytics

ranjithd_0-1665480770459.png

 

After you can use

s.charSet = "UTF-8";
s.trackDownloadLinks = true;
s.trackExternalLinks = true;
s.trackInlineStats = true;

 

s.---- values in all the trackings.

 

Refer:

https://experienceleague.adobe.com/docs/analytics-learn/tutorials/implementation/via-adobe-launch/co...

 

Avatar

Correct answer by
Level 4

The answer is ... it depends. Inside of Adobe launch, if you are creating rules or custom conditions - The s variable will be scoped in and available to use. So no need to declare it, Adobe Launch + the Analytics extension takes care of that for you.

 

If you want to use the "s" variable elsewhere, there is an option in the Launch extension to enable the s variable to be globally accessible. This comes in handle when you have a generic helper method (such as a plugin) that assumes the s variable (is global) instead of allowing the s variable to be passed as a variable(preferred)

Avatar

Level 2

Thanks Tim!

We have window.s set as a global variable in the Adobe Analytics extension.

So basically, when Launch initialises the Adobe Analytics extension, it sets window.s up, and then any subsequent rules won't need to worry about checking for it?

Avatar

Level 4

Correct - When set, I believe you can safely assume the variable exists. So it could be referenced anytime (after initialization) without the dreaded

Uncaught TypeError: Cannot read properties of undefined