With an Adobe Analytics rule, is it necessary to add a condition to check that 's' is defined? | Community
Skip to main content
Level 2
October 11, 2022
Solved

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

  • October 11, 2022
  • 2 replies
  • 1819 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by tim_funk

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)

2 replies

ranjithd
Level 4
October 11, 2022

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=en

 

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

Adobe Analytics

 

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/configuring-global-variables-in-the-launch-analytics-extension.html?lang=en

 

tim_funk
tim_funkAccepted solution
Level 3
October 11, 2022

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)

Level 2
October 11, 2022

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?

tim_funk
Level 3
October 11, 2022

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