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

satishk38346838

24-10-2016

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

Accepted Solutions (1)

Accepted Solutions (1)

ParitMittal

26-10-2016

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

Answers (2)

Answers (2)

jantzen_belliston-Adobe

Community Manager

13-12-2016

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

satishk38346838

26-10-2016

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