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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Adobe DTM s_code management

Avatar

Level 2

Hi,

I just starting using DTM and I want my s_code being managed in DTM. My s_code currently include a lot of plugins. If I save all the complete code with configuration section, plugins....it works fine but satellite doesn´t rewrite the s_account variable. The resullt is that I always point to the same report suite in stage and live enviromment.
I can´t remove s_account setting of s_code ¿Is there any way to get the live and stage account numbers set in satellite from s_code?

Thanks.

 
1 Accepted Solution

Avatar

Correct answer by
Level 3

We are looking at some ways of making this a built-in feature in the engine. There are a few things that make this tricky to implement in a way that works for everyone.

However, in the meantime, you can create a function similar to the following:

function getAnalyticsAccount() { for(var toolid in _satellite.tools) { if(_satellite.tools[toolid].settings.engine == "sc") { return _satellite.tools[toolid].settings.account; } } }

And then in your s_code you can use it like this:

var s_account = getAnalyticsAccount();

This will automatically get the values that you've set in the DTM interface and pass them to your s_code file.  The only caveat is that this will only work for the first Adobe Analytics tool you have installed in a given web property. If you have multiple Analytics tool instances installed in a single web property, the function above will only return the account value for the first one.

I hope this helps. Thanks for using DTM!

3 Replies

Avatar

Correct answer by
Level 3

We are looking at some ways of making this a built-in feature in the engine. There are a few things that make this tricky to implement in a way that works for everyone.

However, in the meantime, you can create a function similar to the following:

function getAnalyticsAccount() { for(var toolid in _satellite.tools) { if(_satellite.tools[toolid].settings.engine == "sc") { return _satellite.tools[toolid].settings.account; } } }

And then in your s_code you can use it like this:

var s_account = getAnalyticsAccount();

This will automatically get the values that you've set in the DTM interface and pass them to your s_code file.  The only caveat is that this will only work for the first Adobe Analytics tool you have installed in a given web property. If you have multiple Analytics tool instances installed in a single web property, the function above will only return the account value for the first one.

I hope this helps. Thanks for using DTM!

Avatar

Level 2

Many thanks

It works but I had to remove the first member of condition

(toolid.indexOf("satellite-") == 0 

var toolid just stores hex identifiers for tools (no matches for  'satellite' string)

Regards

Avatar

Level 3

My apologies; you're correct. That prefix was used on some older legacy accounts but I don't believe it's in use anymore.

-Shawn