Advertisement
rmalcoriza

AdMetrics Snippet

Jul 12th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. //Download the Javascript File Here: https://drive.google.com/open?id=1lyLtoY31jO8zKMqaUHBcT988xHlk544P
  2. //Upload the metrics_ss.min.js file together with your creative files in Studio
  3. //PASTE THIS BELOW THE CODE: Enabler.setDevDynamicContent(devDynamicContent);
  4. //Replace the dynamicContent.AdLib__Tesco_BargainHunters_AdLib__Tesco_BargainHunters[0].Reporting_Label with the reporting label from your dynamic invocation code.
  5.  
  6. var campaignID = Enabler.getParameter("buy");
  7. var advertiserID = Enabler.getParameter("adv");
  8. loadAdMetrics();
  9.  
  10. function loadAdMetrics(){
  11. window.ADM_INIT_PARAMS = {
  12. ca: encodeURIComponent(campaignID),
  13. aid: encodeURIComponent(advertiserID),
  14. tag: encodeURIComponent(dynamicContent.AdLib__Tesco_BargainHunters_AdLib__Tesco_BargainHunters[0].Reporting_Label),
  15. ii: +new Date() + '' + (Math.floor(Math.random() * 9e5) + 1e5),
  16. ev: 'lavisheduc',
  17. cl: 326704,
  18. cn: 0
  19. };
  20. console.log("Campaign ID: "+campaignID)
  21. console.log("Advertiser ID: "+advertiserID)
  22. console.log("Reporting Label ID: "+dynamicContent.AdLib__Tesco_BargainHunters_AdLib__Tesco_BargainHunters[0].Reporting_Label)
  23.  
  24.  
  25. var script = document.createElement('script');
  26. script.type = 'text/javascript';
  27. script.src = 'metrics_ss.min.js';
  28. document.body.appendChild(script);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement