Expand my Community achievements bar.

SOLVED

I am not able to set eVars/Props in DTM custom script.

Avatar

Level 3

Hi,

I want to set eVars,events and props using custom script, but  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.
  3.     I tried using below code but it's not working     

            var s = _satellite.getToolsByType('sc')[0].getS();
            s.linkTrackVars="prop1,events";
            s.linkTrackEvents="event1";
            s.events="event1";
            s.prop1="test";
            showing below error message in console "Cannot set property 'linkTrackVars' of null".

Kindly let me know how to set eVars and props by using Custom script in Page load Rules/ Even based rules( DTM)

Thanks & Regards,

Satish Kumar G

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Sathish,

In  Event/ Page Load rules,   "s" object is accessible inside  "Custom Page Code" section of Adobe Analytics Tab even without using "var s=_satellite.getToolsByType("sc")[0].getS();".  

"var s=_satellite.getToolsByType('sc')[0].getS();" should always be used in the cases when "s" object needs to referenced in ThirdParty/Javascript or Conditions section of Event/Page Load rule

This should have ideally worked. Can you please share your  DTM account details as well as URL of website in a private message so that we can debug the same at our end

Thanks & Regards 

Parit Mittal

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Hi Sathish,

In  Event/ Page Load rules,   "s" object is accessible inside  "Custom Page Code" section of Adobe Analytics Tab even without using "var s=_satellite.getToolsByType("sc")[0].getS();".  

"var s=_satellite.getToolsByType('sc')[0].getS();" should always be used in the cases when "s" object needs to referenced in ThirdParty/Javascript or Conditions section of Event/Page Load rule

This should have ideally worked. Can you please share your  DTM account details as well as URL of website in a private message so that we can debug the same at our end

Thanks & Regards 

Parit Mittal

Avatar

Level 3

Hi Parit

we have worked in this way. Also add this line "After setting var s=_satellite.getToolsByType('sc')[0].getS(); in Custom JavaScript we are getting following error "Cannot set property 'eVar28' of null" . But it's not working for us.  

I would like to know how globally we can set var s = s_gi() method in AppMeasurement. We want to set the props/eVars/events/Products using custom script in DTM.

Sharing account details may not be possible. Could we please have some session or desktop sharing to discuss about this?

Kindly provide the details in private message.

Thanks & Regards,

Satish Kumar G

Avatar

Level 10

Satish,

You may want to open a ticket with Customer Care. They have the ability to join you on a screen share session for troubleshooting if needed.

 

Regards,
Jantzen