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

SOLVED

Not able to use s.linkTrackVars & s.linkTrackEvents.

ParthaS
Level 2
Level 2

Hi Team,

 

I am using "Third Party Tag" section of DTM for hosting my code but in this section I am facing couple of problems -

 

1. It doesn't recognize any reference of s object.

2. I was able to create a reference of s object (var s=new Appmeasurement();) but not it doesn't recognize any of the methods of s object like s.linkTrackVars & s.linkTrackEvents.

 

So for custom link tracking how do I solve the problem of using s.linkTrackVars & s.linkTrackEvents in Third Party Tag section? In general how do I use s object in Third Party Tag section of DTM?

 

Please help.

 

Regards,

~Partha.

1 Accepted Solution
AlexisCazes
Correct answer by
Community Advisor
Community Advisor

Hi Partha,

The Adobe Analytics object from the tool is local to DTM web property and cannot be used as it is in the third party code section.

 

Use the following code:

var s = _satellite.getToolsByType('sc')[0].getS(); s.linkTrackVars="prop1,events"; s.linkTrackEvents="event1"; s.events="event1"; s.prop1="test"; s.tl(this,"o","test",null,"navigate");

All of the Adobe Analytics tool have a type of sc, so if you have more than one tool, make sure to select the right index.

Please confirm if it solves your issue.

 

Best regards.

 

Alexis Cazes

Senior Technical Support Engineer

View solution in original post

5 Replies
AlexisCazes
Correct answer by
Community Advisor
Community Advisor

Hi Partha,

The Adobe Analytics object from the tool is local to DTM web property and cannot be used as it is in the third party code section.

 

Use the following code:

var s = _satellite.getToolsByType('sc')[0].getS(); s.linkTrackVars="prop1,events"; s.linkTrackEvents="event1"; s.events="event1"; s.prop1="test"; s.tl(this,"o","test",null,"navigate");

All of the Adobe Analytics tool have a type of sc, so if you have more than one tool, make sure to select the right index.

Please confirm if it solves your issue.

 

Best regards.

 

Alexis Cazes

Senior Technical Support Engineer

View solution in original post

ParthaS
Level 2
Level 2

Hi Alexis,

 

Thanks for responding and your are absolutely correct.

 

I had already implemented it last week and it is working fine - that is the only way to do it. 

 

Take care,

~Partha.

satishk38346838
Level 3
Level 3

Hi,

Same code, I have been implemented but showing "Cannot set property 'linkTrackVars' of null" in the console.

Kindly help how to set eVars,events and props using S object in custom script.

Thanks & Regards,

Satish Kumar G

AlexisCazes
Community Advisor
Community Advisor

Please provide the URL where we can test the issue.

satishk38346838
Level 3
Level 3

I am working in my local environment. Kindly let me know how to set eVars and props by using Custom script in Page load Rules/ Even based rules( DTM) .

Need to follow any steps?  guide me .. 🙂