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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Make global "s" object when loading AppMeasurement library from custom URL – Analytics extension

danielwaloe
Level 1
Level 1

When loading AppMeasurement.js from a custom URL in the Analytics extension:


What's the right way to initialize a global "s" object so Launch can populate it with report suites?

When I do this:

 

var s = s_gi('')

 

I get this console message:

 

Error, missing Report Suite ID in AppMeasurement initialization

 

If I try to pass a dummy report suite ID—var s = s_gi('deleteme')—Launch appends the real report suites to the list in s.allAccounts, resulting in something like s.allAccounts: ['deleteme','ourrealreportsuite'].

 

Right now I'm doing this hack:

 

// Initialize global AppMeasurement object to be accessed by Adobe Launch.
var s = s_gi('deleteme')
delete s.allAccounts

// The AppMeasurement code
function AppMeasurement(r) {...}
function s_gi(r) {...}
AppMeasurement.getInstance = s_gi;
window.s_objectID || (window.s_objectID = 0);
function s_pgicq() {...}
s_pgicq();

 

But there's got to be a proper way of doing this, right?

0 Replies