Expand my Community achievements bar.

SOLVED

Error in DTM when created a new property and added new rule with javascript

Avatar

Level 3

I have created a new property in DTM. Added header and footer code from DTM in the new website. I am using adobe's s_code version which i have set in the property. When I created a page load rule for custom tracking of the navigation it says "Uncaught Reference Error" s is not defined.

The page load rule that i have added is //links tracking

$("a.top-nav-link").click(function() { _satellite.notify('top nav clicked'); var tophatlinks = "ntap:TH:" + $(this).text(); s.eVar14 = tophatlinks; s.linkTrackVars = "eVar14"; s.tl(this,'o'); });

But If i use event based rule it works and doesn't give the error. Since I have to use many click events I thought of adding one page rule and add all the custom tracking there. But this is not working. Any thoughts?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Vidya, 

Since you are using DTM to add to your current Implementation. I assume that you might have initially  checked the box "Page code already present" in Library Management tab in Adobe Analytics tool.

However, it’s important to note the following limitations with this approach:

1. Variables and settings configured in the DTM Adobe Analytics tool will not take effect.
2. Adobe Analytics variables set in page-load rules will not take effect.

These limitations occur because DTM is fully relying on the existing implementation to serve the AppMeasurement code and instantiate the s object.

But now by manual updation I assume that you did the configuration like the below snapshot and copied and pasted your s_code in the code editor.

If you have done what I just assumed above then it's perfectly fine.

Thanks & Regards

Parit Mittal

View solution in original post

5 Replies

Avatar

Level 3

I made it work by adding custom s_code while updating the property. Adding s_account and commenting some unnecessary code it is working. Can you please let me know if this is the right way to fix this issue?

Avatar

Level 9

Hi Vidya,

Can you send me the company name, property name, and page load name rule via a private message?

Thanks!

Tacia

Avatar

Level 10

Hi Vidya, 

Can you please share the custom s_code being added by you to the DTM property.Also, let us know what piece of code was commented by you.

Thanks & Regards

Parit Mittal

Avatar

Level 3

Hi Parit,

I took the netapp.com s_code file http://www.netapp.com/us/static/js/s_code.js and added s_account values for this site and commented visitor Id which we dint implement yet for other sites and commented the last line "Omniture.System.process();" which actually calls our omniture.js file. Now the page level rule works fine. So the conclusion is we have to manually update s_code there in the tool?

I appreciate your quick response. Thank you so much. It helps me a lot.

Regards,

Vidya

Avatar

Correct answer by
Level 10

Hi Vidya, 

Since you are using DTM to add to your current Implementation. I assume that you might have initially  checked the box "Page code already present" in Library Management tab in Adobe Analytics tool.

However, it’s important to note the following limitations with this approach:

1. Variables and settings configured in the DTM Adobe Analytics tool will not take effect.
2. Adobe Analytics variables set in page-load rules will not take effect.

These limitations occur because DTM is fully relying on the existing implementation to serve the AppMeasurement code and instantiate the s object.

But now by manual updation I assume that you did the configuration like the below snapshot and copied and pasted your s_code in the code editor.

If you have done what I just assumed above then it's perfectly fine.

Thanks & Regards

Parit Mittal