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

DTM not capturing variables set on page

Avatar

Level 2

We have a website that we are migrating to DTM and have decided not to move all the variable-setting page code into DTM. For example:

                            
<script type="text/javascript">
  
 s.prop14 = s.eVar12 = !s.prop14 && window['readCookie'] && readCookie("ouid") || s.prop14;
 // Assume current user has the same account as before
 s.eVar58 = window['readCookie'] && readCookie("ut") || "";
  
 </script>

For some reason, DTM does not want to process that information. It appears to be skipping anything that is an s object outside the s_code that is hosted within DTM. Has anyone seen this before or can anyone offer any thoughts as to why it isn't setting those variables that are in the page code?

Thanks,
Chad

 

1 Accepted Solution

Avatar

Correct answer by
Level 3

No problem, Chad. More often than not when a site is transitioning, you have valuable data on the page that you still want. In those cases, my first recommendation is to change the vars as I mentioned. If that's too difficult, I'd recommend changing the object in DTM to something other than "s" while ensuring that your vars on the page still have s defined so that they don't error out, and then set those as data elements in DTM and assign as needed in your rules.

- Jason

View solution in original post

0 Replies

Avatar

Community Advisor

Hi Chad,

 

Please check if you are calling the s.t() function before that you run this code. If it is the case then it might be the issue as once s.t() is called it sends an image request with all the variables initialized prior the function is called. Any s. variables set after the function is called will not be send.

 

Best regards.

 

Alexis Cazes

Avatar

Level 2

Alexis,

We're using DTM to manage the tracking, so there is no s.t() being set. It just seems like DTM is setting an s object that is conflicting with or ignoring the page code.

Thanks for reaching out!
Chad

Avatar

Level 3

Chad,

Are you trying to use the "Code Exists on the Page" option with in DTM, or are you letting DTM manage the analytics library and trying to set vars directly on the page using s.propX in addition to what you're in a DTM implementation?

If you're migrating anyway, I'd also suggest ditching the "s" object on the page in favor of something else that's not specific to Adobe nomenclature. Something along the lines of:

analytics.userAccount="[cookie value]";

Then setup a data element and in fact do it in DTM.

But, I think it would help if you could elaborate a little more on exactly how you are migrating.

- Jason

Avatar

Level 2

Jason,

We are not using the "code exists" functionality. We are trying to do as you are saying...use DTM to manage the analytics library and trying to set vars directly on the page in addition to what we'll set up in DTM. This is because we have some complex logic occurring in various areas of the site which are populating the variables and we'd like to keep that in place for the time being until we have time to go back and put it all in DTM.

I'll run your suggestion by our developer and see what he says. Thank you for reaching out to help!

Chad

Avatar

Correct answer by
Level 3

No problem, Chad. More often than not when a site is transitioning, you have valuable data on the page that you still want. In those cases, my first recommendation is to change the vars as I mentioned. If that's too difficult, I'd recommend changing the object in DTM to something other than "s" while ensuring that your vars on the page still have s defined so that they don't error out, and then set those as data elements in DTM and assign as needed in your rules.

- Jason