html PepsiCo:BlueKai:CoreTag:国家站点模板[遗产]
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html PepsiCo:BlueKai:CoreTag:国家站点模板[遗产]相关的知识,希望对你有一定的参考价值。
<!--
- For use in Google Tag Manager
- Use DOM Ready trigger to fire
- Ensure {{BlueKai Container ID}} variable in GTM is set to the relevant ID for that page
-->
<!-- BlueKai Tag : Auto Detect Social Events : Requires jQuery : Fire on DOM Ready Trigger in Google Tag Manager -->
<script type="text/javascript">
if(window.jQuery && jQuery.fn && jQuery.fn.jquery){
// FUNCTION : Link Tracking Function : DO NOT CHANGE
var add_link_tracking = function(social_keyword,social_network_name){
jQuery('a[href*="' + social_keyword + '"]').mousedown(function(event_data){
bk_addPageCtx('event_type','social link click');
bk_addPageCtx('social_network',social_network_name);
bk_addPageCtx('event_detail',this.href);
BKTAG.doTag({{BlueKai Container ID}}, 4);
})
}
// Add social networks here
add_link_tracking("twitter","twitter"); // search keyword in link URL, name of social network to pass to BlueKai
add_link_tracking("facebook","facebook"); // etc
add_link_tracking("youtube","youtube"); // etc
add_link_tracking("instagram","instagram"); // etc
}
</script>
<!-- PepsiCo Form Tracking -->
<!-- Assuming there is a BlueKai CoreTag already on the page and "//tags.bkrtx.com/js/bk-coretag.js" has been loaded -->
<!-- Begin BlueKai Tag -->
<script type="text/javascript">
// Surface email address if available
bk_addEmailHash('ENTER_RAW_EMAIL_ADDRESS_HERE'); // this will MD5 and SHA256 hash it before sending to BlueKai
BKTAG.doTag(BLUEKAI_OFFLINE_CONTAINER_ID, 4); // Enter the offline container ID here
// Surface useful data here (uncomment the below code and customise with the data you want to send)
//bk_addPageCtx('NAME_OF_VAR', 'VALUE_OF_VAR'); // You can send lots of pieces of data here
//bk_addPageCtx('brand', 'pepsi.co.uk'); // Example
//bk_addPageCtx('form_type', 'competition entry'); // Example
bk_addPageCtx('event_name', 'form submit'); // Denotes a form submission
BKTAG.doTag(BLUEKAI_CONTAINER_ID, 4); // Enter the container ID here
</script>
<!-- Contains UNSUPPORTED CODE from lines 16-43 - use at your own risk -->
<!-- For use in Google Tag Manager -->
<!-- Use DOM Ready trigger to fire -->
<!-- Ensure "BlueKai Container ID" variable in GTM is set to the relevant ID for that country -->
<!-- Ensure "Hashed Email Address" variable is set to the value of a hashed email address -->
<!-- Ensure "BlueKai Offline Container ID" variable is set to the value of the offline container ID -->
<!-- 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({{BlueKai Offline Container ID}}, 4);
};
// CONTACT US DETECTION : Add in terms to look for in the URL to know it is a contact us page (e.g. /contact|contact-us|general-enquiries/)
if(document.location.href.match(/contact|contact-us|general-enquiries/)){
bk_addPageCtx('contact_page','true');
};
// PRODUCT PAGE DETECTION : Add in terms to look for in the URL to know it is a product page (e.g. /product|produkte/)
if(document.location.href.match(/product|produkte/)){
bk_addPageCtx('product_page','true');
};
// Send Data
BKTAG.doTag({{BlueKai Container ID}}, 4); // Ensure {{BlueKai Container ID}} is the name of whatever var you're using in GTM to determine the container ID
};
(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>
<!-- For use in Google Tag Manager -->
<!-- Use DOM Ready trigger to fire -->
<!-- Ensure "BlueKai Container ID" variable in GTM is set to the relevant ID for that country -->
<!-- Ensure "Hashed Email Address" variable is set to the value of a hashed email address -->
<!-- Ensure "BlueKai Offline Container ID" variable is set to the value of the offline container ID -->
<!-- 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;
// <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({{Hashed Email Address}}){
bk_addPageCtx('e_id_m', {{Hashed Email Address}})
BKTAG.doTag({{BlueKai Offline Container ID}}, 4);
};
// CONTACT US DETECTION : Add in terms to look for in the URL to know it is a contact us page (e.g. /contact|contact-us|general-enquiries/)
if(document.location.href.match(/contact|contact-us|general-enquiries/)){
bk_addPageCtx('contact_page','true');
};
// PRODUCT PAGE DETECTION : Add in terms to look for in the URL to know it is a product page (e.g. /product|produkte/)
if(document.location.href.match(/product|produkte/)){
bk_addPageCtx('product_page','true');
};
// Send Data
BKTAG.doTag({{BlueKai Container ID}}, 4); // Ensure {{BlueKai Container ID}} is the name of whatever var you're using in GTM to determine the container ID
};
(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 PepsiCo:BlueKai:CoreTag:国家站点模板[遗产]的主要内容,如果未能解决你的问题,请参考以下文章