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



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() {...}


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

Accepted Solutions (0)

Answers (0)