How to use DTM account settings for s_code.js? | Community
Skip to main content
Michael_Schuber
Level 3
October 16, 2015
Solved

How to use DTM account settings for s_code.js?

  • October 16, 2015
  • 3 replies
  • 2643 views

Using the JS 1.2. Appmeasurement s_code you have to create the tracking object

s = new AppMeasurement();
s.account="xxx";

How can you use the account variables of DTM in this setting to select the right account dependent on the embed code (Staging or Live) ???

Thanks,

Michael

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

Update: That conversation was moved to our new DTM specific forum and is now located here: http://help-forums.adobe.com/content/adobeforums/en/marketing-cloud-forum/activation.topic.html/forum__mstc-hi_i_just_starti.html

3 replies

ericmatisoff1
Level 5
October 16, 2015

Hey Michael,

Not sure if you've figured this out yet or not. If not, my recommendation is to put dev report suites in the account section of DTM and use the s_code editor to create logic that decides which report suite to send the data to. In my experience, the s.account variable in s_code overwrites the items defined in the Tool's Production/Staging Account/Suite.

I've also noticed that developers seem to get confused by (or simply forget to) remove the -staging.js in the <head> embed code for DTM. To get around this, I've started only giving developers the production embed code. I then use the s_code editor to send the data to the proper report suite (based on URL/domain).

Finally, you can use the DTM Switch Plugins to force the staging library in your staging environment for testing: 
http://help-forums.adobe.com/content/adobeforums/en/marketing-cloud-forum/adobe-marketing-cloud.topic.html/forum__lkzf-_dtm_switchdt.html

Hope that helps! I'm happy to entertain a discussion regarding doing things a different way :)

- Eric

October 16, 2015

Hi Michael,

there is a code snippet available to be able to automatically grab the account setting var from DTM and use it in s.account:
http://help-forums.adobe.com/content/adobeforums/en/marketing-cloud-forum/adobe-marketing-cloud.topic.html/forum__mstc-hi_i_just_starti.html

 

Greetings,
Mascha

Adobo_Supportus
Adobo_SupportusAccepted solution
Level 7
October 16, 2015

Update: That conversation was moved to our new DTM specific forum and is now located here: http://help-forums.adobe.com/content/adobeforums/en/marketing-cloud-forum/activation.topic.html/forum__mstc-hi_i_just_starti.html