Hi Jills ,
Please find below my comments in Italic to answer your queries.
1. How can I set a global linkTrackVars (i.e. a list of variables that must be sent in *every* link tracking (s.tl) call
While using the s_code.js file we were using, s.linkTrackVars="eVar1,eVar2" in the global js file configuration section and then in the custom link tracking code we will add s.linkTrackVars+ =",eVar3,eVar4". In this way, we will have eVar1 and eVar2 sent in all custom link tracking call. Is there such a feature available in DTM? Or do I need to add those variables individually in every event based s.tl rules?
// In DTM ,To set the global linkTrackVars we take the same approach i.e. you have to specify the s.linkTrackVars="eVar1,eVar2" in App Measurement file hosted in DTM or if the library file is managed by Adobe then you have to specify the same in "Custom Page Code" of the Analytics tools using the option "After UI settings takes place".
2. How can I set multiple products in the same tracking call?
What I meant here was: How can I create a dynamic (or array) data element for products in DTM to track multiple values from same page?
e.g. I have three products displayed on a page. I need to send these products to Omniture for track product views.
It may be possible to use the code s.products=";" + _satellite.getVar("ProductID1,")+";" + _satellite.getVar("ProductID2,")+";" + _satellite.getVar("ProductID3"); but I'm sure this is not the correct way of doing it. What if there are 5 products on page, or 50 products? How can I track all listed products in DTM?
// To Achieve the same , Please create a data element "ProdArray" of type "Custom Script " like below to store all the Products Viewed on a page in an array and then return the array from custom script. var Product_array=new Array() ; Product_array[0]="ID1";// Write your own custom logic to fetch product Id's from the HTML of page or data layer and store them in the array Product_array[1]="ID2";// Write your own custom logic to fetch product Id's from the HTML of page or data layer and store them in the array
return Product_array;
On the Product Page Load rule, In Adobe Analytics custom code section write your own logic like below :
var data_view= _satellite.getVar('ProdArray'); if(data_view!="") { for(var x_view=0, xlen_view=data_view.length;x_view<xlen_view;x_view++){ if(x_view==0) { product_view=";" + data_view[x_view]; } else { product_view=product_view+ ","+";" +data_view[x_view]; } } } s.linkTrackVars = 'products'; s.linkTrackEvents = 'ProdView'; s.events="ProdView" s.products=product_view ; }
Thanks& Regards
Parit Mittal