html 示例BlueKai CoreTag
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 示例BlueKai CoreTag相关的知识,希望对你有一定的参考价值。
<!-- If running in Google Tag Manager use DOM Ready trigger to fire -->
<!-- If coding directly to the page, insert at top of <body> (or as close as you can) -->
<!-- Begin BlueKai Tag -->
<script type="text/javascript">
window.bk_async = function() {
// ALLOW MULTIPLE CALLS/SINGLE PAGE APPS
bk_allow_multiple_calls=true; bk_use_multiple_iframes=true;
// Grab Query-String Parameters // grab from urlP["nameofparameter"], e.g. urlP["email_id"]
var urlP;
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function(s) {
return decodeURIComponent(s.replace(pl, " "));
},
query = window.location.search.substring(1);
urlP = {};
while (match = search.exec(query))
urlP[decode(match[1]).toLowerCase()] = decode(match[2]);
// <optional> PHINTS : Declare variables about this page (or user)
// CUSTOM VARS YOU WANT TO DECLARE : Uncomment this to declare specific vars
//bk_addPageCtx('change_to_var_name','{{GTM Var Name}}'); // Key must only use (a-z,A-Z,0-9,_) characters. Value can be anything
// bk_addPageCtx('brand_name','pepsi'); // An example
// bk_addPageCtx('brand_name','{{brand name}}'); // An example (using GTM vars)
// MD5 hashed email grabber
if(urlP.e_id_m){
bk_addPageCtx('e_id_m', urlP.e_id_m)
BKTAG.doTag(12345, 4);
};
// HOMEPAGE DETECTION : Attempts to detect a homepage
if(document.location.pathname === "/" || document.location.href.toLowerCase().match(/index\.h/)){
bk_addPageCtx('homepage_page','true');
};
// 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/)
if(decodeURI(document.location.href).toLowerCase().match(/contact|temas|kontakt|enquêtes|soruşturma|zapytania|consultas|vragen/)){
bk_addPageCtx('contact_page','true');
};
// 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/)
if(decodeURI(document.location.href).toLowerCase().match(/regist|kayıt|zarejestrować|sign|işaret|znak|firmar|teken|log|identifier|oturum|Zaloguj|iniciar/)){
bk_addPageCtx('reg_sign_in_page','true');
};
// 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/)
if(decodeURI(document.location.href).toLowerCase().match(/search|chercher|arama|szukanie|buscar|zoeken/)){
bk_addPageCtx('search_page','true');
};
// 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/)
if(decodeURI(document.location.href).toLowerCase().match(/product|produit|ürün|produkt|producto|artikel/)){
bk_addPageCtx('product_page','true');
};
// 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/)
if(decodeURI(document.location.href).toLowerCase().match(/faq|question|sorular|pytania|preguntas|vragen/)){
bk_addPageCtx('faq_page','true');
};
// 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/)
if(decodeURI(document.location.href).toLowerCase().match(/disclaimer|zrzeczenie|term|şartlar|warunki|condiciones|dénégation/)){
bk_addPageCtx('t_and_c_page','true');
};
// Send Data
BKTAG.doTag(23456, 4);
};
(function() {
var scripts = document.getElementsByTagName('script')[0];
var s = document.createElement('script');
s.async = true;
s.src = "//tags.bkrtx.com/js/bk-coretag.js";
scripts.parentNode.insertBefore(s, scripts);
}());
</script>
以上是关于html 示例BlueKai CoreTag的主要内容,如果未能解决你的问题,请参考以下文章
html HBO Nordics:BlueKai CoreTag
html Paysafe:BlueKai CoreTag:GTM建议代码