Referencing global s object outside of Launch

Avatar

Avatar
Validate 50
Level 8
SarahEOwen
Level 8

Likes

269 likes

Total Posts

408 posts

Correct reply

17 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 1
View profile

Avatar
Validate 50
Level 8
SarahEOwen
Level 8

Likes

269 likes

Total Posts

408 posts

Correct reply

17 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 1
View profile
SarahEOwen
Level 8

02-10-2017

We were thinking about moving to "Manage the Library for me" with Launch. Will the global s object be accessible outside of Launch without customizing the code (hece not being able to go with the "Manage the Library for me")?

How to get a global “s” object in DTM | Digital Data Tactics

EDIT: Moved to the questions since this isn't really a bug - JB

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile
thebenrobb
Employee

16-10-2017

Hey SarahEOwen, I heard back sooner than expected.  There is a feature request logged to have an option in the extension configuration to globalize the ' s' object.

Until that happens, there are two options to try.

1) At the bottom of the extension configuration view for the Analytics extension, there is a custom code box.  If you put

in that custom code box, that will give you an s object on the page that you should be able to use in the way you'd like it.

2) You could also try getting the 's' object from

which is an array (I think) where the Analytic instances are stored.

--

AN-148610

Answers (4)

Answers (4)

Avatar

Avatar
Validate 50
Level 8
SarahEOwen
Level 8

Likes

269 likes

Total Posts

408 posts

Correct reply

17 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 1
View profile

Avatar
Validate 50
Level 8
SarahEOwen
Level 8

Likes

269 likes

Total Posts

408 posts

Correct reply

17 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 1
View profile
SarahEOwen
Level 8

17-10-2017

Thanks so muchthebenrobb​! I will do the coding suggested in #1 above in Launch and play with #2

Avatar

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile
thebenrobb
Employee

16-10-2017

Sorry, I think I'm going to have to leave this one for Aaronius9er9er9er to handle.  Actually, on second thought, it's the Analytics team (the extension devs) that need to answer that one.  I'll see what I can find out.

Avatar

Avatar
Validate 50
Level 8
SarahEOwen
Level 8

Likes

269 likes

Total Posts

408 posts

Correct reply

17 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 1
View profile

Avatar
Validate 50
Level 8
SarahEOwen
Level 8

Likes

269 likes

Total Posts

408 posts

Correct reply

17 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Ignite 1
View profile
SarahEOwen
Level 8

16-10-2017

Hi thebenrobb​ -

I think I didn't explain myself very well...let me try again

In order for our survey provider to set s.contextData variables and fire off an s.tl() call when a survey event occurs, I was told to read this article and follow its guidance: How to get a global “s” object in DTM | Digital Data Tactics

One of my short-term goals it to utilize the "manage the library for me" feature of the Adobe Analytics extension (vs "let me provide custom library code") so the site can easily stay on the most recent version. In order to achieve my goal, there would need to be a way that either the Launch extension can handle this situation or maybe something could be added to the Adobe Analytics extension configuration area that would allow me to enter this type of information and not have to touch the code (which requires me to use the "let me provide custom library code").

1325581_pastedImage_0.png

Thanks so much -

Sarah

Avatar

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile

Avatar
Contributor
Employee
thebenrobb
Employee

Likes

145 likes

Total Posts

318 posts

Correct reply

83 solutions
Top badges earned
Contributor
Seeker
Shape 1
Give Back 3
Give Back
View profile
thebenrobb
Employee

13-10-2017

The s object exposed by the Analytics extension is not a global object.  You can reference it as 's' from within custom code in Launch, but once it's packaged up and delivered to the page you won't be able to find it (in the browser console for example).