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

DTM: plugins in the AppMeasurement library do to work

Avatar

Avatar
Validate 1
Level 2
zloi_dvornik
Level 2

Likes

3 likes

Total Posts

31 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
zloi_dvornik
Level 2

Likes

3 likes

Total Posts

31 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
zloi_dvornik
Level 2

05-01-2017

I set Library Management to 'Custom' as I wanted to add some plugins including a customised one. At some point I noticed that they stopped working. I resolved it this way: I ticked the box  'Set report suites using custom code below' and defined s_account inside the library. Surely, this is not the only way to make it work. How can I troubleshoot what is not working correctly? Ideally I'd like to have report suites defined in the DTM UI rather than in the AppMeasurement code. Thanks. 

Replies

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

91 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

91 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

05-01-2017

Hi ,

Are you using/calling your plugin functions (Code inserted in Appmeasurement Library) from code on the page (or a developer console) or even non-analytics code blocks in DTM (like Third Party Tags) ? . If yes, then it is happening because at this point in time, by default, DTM creates your analytics object (usually an "s", as in "s.pageName") with a local scope. This means it should be able to be referenced from any custom code blocks within DTM that are tied to your analytics tool.

The only way to overcome the above situation is to define your own "s" object within your library. This does mean you can't let DTM manage your library, but the change you need to make is pretty minor. You need a "Custom" configuration, and you'll need to "Set report suites using custom code below" (since you're essentially going to be overwriting the "s" object that DTM created, where it set your report suites for you) and in this way "s" object is created with a Global Scope.

Also, Can you please confirm that when your plugin code is not working then ,Are you seeing any error in the Dev console like : "Uncaught Reference Error : s is not defined".

Thanks & Regards

Parit Mittal

Avatar

Avatar
Validate 1
Level 2
zloi_dvornik
Level 2

Likes

3 likes

Total Posts

31 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
zloi_dvornik
Level 2

Likes

3 likes

Total Posts

31 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
zloi_dvornik
Level 2

06-01-2017

Hi Parit   Thanks a lot  for your reply. Actually, no. I was calling plugins from the AppMeasurement itself. And it stopped working. I managed to fix it by moving plugins and s.doPlugins into the Customise Page Code section. it seems to be working OK now. But I still don't understand why it didn't work in the initial set up as all plugins were configured inside the AppMeasurement code, so should be working fine with the local scope in this case. 

Avatar

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

91 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 10
Level 10
ParitMittal
Level 10

Likes

91 likes

Total Posts

817 posts

Correct Reply

349 solutions
Top badges earned
Validate 10
Validate 1
Boost 50
Boost 5
Boost 3
View profile
ParitMittal
Level 10

08-01-2017

Hi ,

Yes, It should have actually worked . Can you please share your DTM Account login details as well as test url of the website in a private message so that we can debug the issue at our end.

Thanks & Regards

Parit Mittal