Make global "s" object when loading AppMeasurement library from custom URL – Analytics extension | Community
Skip to main content
May 19, 2020
Question

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

  • May 19, 2020
  • 0 replies
  • 2473 views

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?

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