Advertisement
lfischer

Otto - Email tracking

Dec 19th, 2018
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Parse the URL and gives the value for a given key
  2. function getParameterByName(name) {
  3.     name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  4.     var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
  5.         results = regex.exec(location.search);
  6.     return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
  7. }
  8.  
  9. // Pass the value to the tag (example for a product tag)
  10. <script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
  11. <script type="text/javascript">
  12. window.criteo_q = window.criteo_q || [];
  13. window.criteo_q.push(  
  14.         { event: "setAccount", account: 50545 },
  15.         { event: "setSiteType", type: "d" },
  16.         { event: "viewItem", item: "abc123456", utmmedium: getParameterByName("utm_medium") }
  17. );
  18. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement