Advertisement
Guest User

Untitled

a guest
May 26th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. <!-- If running in Google Tag Manager use DOM Ready trigger to fire -->
  2. <!-- If coding directly to the page, insert at top of <body> (or as close as you can) -->
  3.  
  4. <!--­ Begin BlueKai Tag ­­-->
  5. <script type="text/javascript">
  6. window.bk_async = function() {
  7.  
  8. // ALLOW MULTIPLE CALLS/SINGLE PAGE APPS
  9. bk_allow_multiple_calls=true; bk_use_multiple_iframes=true;
  10.  
  11. // Grab Query-String Parameters // grab from urlP["nameofparameter"], e.g. urlP["email_id"]
  12. var urlP;
  13. var match,
  14. pl = /\+/g, // Regex for replacing addition symbol with a space
  15. search = /([^&=]+)=?([^&]*)/g,
  16. decode = function(s) {
  17. return decodeURIComponent(s.replace(pl, " "));
  18. },
  19. query = window.location.search.substring(1);
  20.  
  21. urlP = {};
  22. while (match = search.exec(query))
  23. urlP[decode(match[1]).toLowerCase()] = decode(match[2]);
  24.  
  25. // <optional> PHINTS : Declare variables about this page (or user)
  26.  
  27. // CUSTOM VARS YOU WANT TO DECLARE : Uncomment this to declare specific vars
  28.  
  29. //bk_addPageCtx('change_to_var_name','{{GTM Var Name}}'); // Key must only use (a-z,A-Z,0-9,_) characters. Value can be anything
  30.  
  31. // bk_addPageCtx('brand_name','pepsi'); // An example
  32. // bk_addPageCtx('brand_name','{{brand name}}'); // An example (using GTM vars)
  33.  
  34. // MD5 hashed email grabber
  35. if(urlP.e_id_m){
  36. bk_addPageCtx('e_id_m', urlP.e_id_m)
  37. BKTAG.doTag(12345, 4);
  38. };
  39.  
  40. // HOMEPAGE DETECTION : Attempts to detect a homepage
  41. if(document.location.pathname === "/" || document.location.href.toLowerCase().match(/index\.h/)){
  42. bk_addPageCtx('homepage_page','true');
  43. };
  44.  
  45. // CONTACT US DETECTION : Add in terms to look for in the URL to know it is this type of page (e.g. /term-1|term-2|term-3/)
  46. if(decodeURI(document.location.href).toLowerCase().match(/contact|temas|kontakt|enquêtes|soruşturma|zapytania|consultas|vragen/)){
  47. bk_addPageCtx('contact_page','true');
  48. };
  49.  
  50. // REGISTER/SIGN IN DETECTION : Add in terms to look for in the URL to know it is this type of page (e.g. /term-1|term-2|term-3/)
  51. if(decodeURI(document.location.href).toLowerCase().match(/regist|kayıt|zarejestrować|sign|işaret|znak|firmar|teken|log|identifier|oturum|Zaloguj|iniciar/)){
  52. bk_addPageCtx('reg_sign_in_page','true');
  53. };
  54.  
  55. // SEARCH DETECTION : Add in terms to look for in the URL to know it is this type of page (e.g. /term-1|term-2|term-3/)
  56. if(decodeURI(document.location.href).toLowerCase().match(/search|chercher|arama|szukanie|buscar|zoeken/)){
  57. bk_addPageCtx('search_page','true');
  58. };
  59.  
  60. // PRODUCT PAGE DETECTION : Add in terms to look for in the URL to know it is this type of page (e.g. /term-1|term-2|term-3/)
  61. if(decodeURI(document.location.href).toLowerCase().match(/product|produit|ürün|produkt|producto|artikel/)){
  62. bk_addPageCtx('product_page','true');
  63. };
  64.  
  65. // FAQ PAGE DETECTION : Add in terms to look for in the URL to know it is this type of page (e.g. /term-1|term-2|term-3/)
  66. if(decodeURI(document.location.href).toLowerCase().match(/faq|question|sorular|pytania|preguntas|vragen/)){
  67. bk_addPageCtx('faq_page','true');
  68. };
  69.  
  70. // Ts & Cs PAGE DETECTION : Add in terms to look for in the URL to know it is this type of page (e.g. /term-1|term-2|term-3/)
  71. if(decodeURI(document.location.href).toLowerCase().match(/disclaimer|zrzeczenie|term|şartlar|warunki|condiciones|dénégation/)){
  72. bk_addPageCtx('t_and_c_page','true');
  73. };
  74.  
  75. // Send Data
  76. BKTAG.doTag(23456, 4);
  77. };
  78. (function() {
  79. var scripts = document.getElementsByTagName('script')[0];
  80. var s = document.createElement('script');
  81. s.async = true;
  82. s.src = "//tags.bkrtx.com/js/bk-coretag.js";
  83. scripts.parentNode.insertBefore(s, scripts);
  84. }());
  85. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement