Expand my Community achievements bar.

SOLVED

Event-based rules not capturing dynamic reporting suite within "Customize Page Code"

Avatar

Level 2

Within the Adobe Analytics tool, under Code Configuration, I have it set to "Custom" and the option for "Set reporting suites using custom code below" is checked. Then I have the code hosted within DTM and am loading the latest version of AppMeasurement  v.1.6.1.

At the top of the code block within "Code Configuration" I have the following code prior to loading the plugins and the AppMeasurement library:

var s = new AppMeasurement();

Then, within "Customize Page Code", I have the following:

s.sa( _satellite.getDataElement('reportingSuite') );

When I fire an event-based rule, this function that sets the reporting suite is not being called and I get an error within the console "SATELLITE: Adobe Analytics: tracker not initialized because account was not found" and "SATELLITE: Adobe Analytics: page code not loaded".

Some blogs have mentioned the only way to get around this within event-based rules is not used the Adobe Analytics tool and manually set your variables within the custom JavaScript section. I find it hard to believe that is the only solution so I am hoping someone here can offer some advice. 

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Laura,

The problem is with the s.sa() function you are using.  It is not recommended to initialize a report suite using s.sa() function.The s.sa() function only lets you dynamically change a report suite at any time on the page, before or after an image request fires.

Hence please use the following code to in "customize page code" to properly initialize  the report suite id to be used for Page Load Rules and Event Based rules.

var r_suite = _satellite.getDataElement('reportingSuite') ; s_account=r_suite; s.account=s_account;

Thanks & Regards

Parit Mittal

View solution in original post

4 Replies

Avatar

Level 7

I use the following code within my analytics tool and never have an issue with events firing or anything, hopefully it might be of some use.

var suiteId //store the s.account if(location.host == ("sitea.com"))  { suiteId = 'mycompany-sitea-prod'; } else if (location.host == ("siteb.com")){ suiteId= 'mycompany-siteb-prod'; } else if (location.host == ("subsite.sitea.com")){ suiteId= 'mycompany-sitec-prod'; } else { suiteId= 'mycompany-sitea-staging'; } s_account = suiteId; //override the DTM reporting suite var s=s_gi(s_account);

I'd maybe try something along the lines of the following and see how that works for you:

s_account =  _satellite.getDataElement('reportingSuite'); var s=s_gi(s_account);

Avatar

Correct answer by
Level 10

Hi Laura,

The problem is with the s.sa() function you are using.  It is not recommended to initialize a report suite using s.sa() function.The s.sa() function only lets you dynamically change a report suite at any time on the page, before or after an image request fires.

Hence please use the following code to in "customize page code" to properly initialize  the report suite id to be used for Page Load Rules and Event Based rules.

var r_suite = _satellite.getDataElement('reportingSuite') ; s_account=r_suite; s.account=s_account;

Thanks & Regards

Parit Mittal

Avatar

Level 2

This resolved the issue, thanks so much!

Avatar

Level 2

Hi Parit,

This solution works as expected, but on page load I still get the following error:

SATELLITE: Adobe Analytics: tracker not initialized because account was not found

The server calls seem to be firing properly however. Should I be worried about this error?

Thank you,

Laura