Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to get the "s" object into the scope of an extension using turbine.getSharedModule

Avatar

Avatar
Springboard
MVP
StewSchilling
MVP

Likes

339 likes

Total Posts

276 posts

Correct Reply

85 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Establish
Contributor
View profile

Avatar
Springboard
MVP
StewSchilling
MVP

Likes

339 likes

Total Posts

276 posts

Correct Reply

85 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Establish
Contributor
View profile
StewSchilling
MVP

26-02-2018

I want to build a Launch extension that can manipulate values on the Adobe Analytics tracker object ("s" by default).

I see in the Feb 8 release notes that the updated Adobe Analytics extension (v1.1) provides access to the tracker object via shared modules.

I see here that the function to call is turbine.getSharedModule

I see via inspection of the api calls on the extensions page that the AA extension name is "adobe-analytics".

So, I'm left with a couple questions:

1) How do I get the updated Adobe Analytics extension (v1.1)?   I only see 1.0.0 in the extension catalog and I don't see any way to update.

2) What is the string to use for the sharedModuleName parament in turbine.getSharedModule? 

My best guess is below:

var sObject = turbine.getSharedModule('adobe-analytics', 'tracker');

Thanks in advance!

-Stew

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
StewSchilling
MVP

Likes

339 likes

Total Posts

276 posts

Correct Reply

85 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Establish
Contributor
View profile

Avatar
Springboard
MVP
StewSchilling
MVP

Likes

339 likes

Total Posts

276 posts

Correct Reply

85 solutions
Top badges earned
Springboard
Bedrock
Validate 1
Establish
Contributor
View profile
StewSchilling
MVP

27-02-2018

Or maybe this? (updated on 12/7/2018)

//Get the function from the adobe-analytics extension

var getTrackerFn = turbine.getSharedModule("adobe-analytics", "get-tracker");

//Call the function, which will return a promise

getTrackerFn().then(function(tracker) {

     // if resolved

     //do stuff with the tracker object (tracker is what we could traditionally call "s")

     tracker.eVar1 = "Josh";

     tracker.eVar2 = "Stew";

}, function(err) {

     //if rejected

     turbine.logger.error("Strange things are afoot at the Circle-K", err);

});

Answers (0)