### Bing Ads Universal Event Tracking Setup (JavaScript) Source: https://www.docket.io/integrations/slack Initializes and configures the Bing Ads Universal Event Tracking (UET) script. It sets up automatic page load tracking and allows for consent management for ad storage. This script is essential for tracking conversions and user behavior for Bing advertising campaigns. ```javascript !function(w,d,t,r,u){ var f,n,i; w[u]=w[u]||[],f=function(){ var o={ti:"187228427", enableAutoSpaTracking: true}; o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad") },n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){ var s=this.readyState; s&&s!="loaded"&&s!="complete"||(f(),n.onload=n.onreadystatechange=null) },i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i) }(window,document,"script","//bat.bing.com/bat.js","uetq"); window.uetq = window.uetq || []; window.uetq.push('consent', 'default', {'ad_storage': 'denied'}); window.uetq = window.uetq || []; window.uetq.push('consent', 'update', {'ad_storage': 'granted'}); ``` -------------------------------- ### Initialize AI Seller Widget Source: https://www.docket.io/platform Initializes and loads an AI seller widget asynchronously. It sets up seller settings, including an agent ID, and dynamically injects the widget's script into the page upon load completion. ```javascript window.AISellerSettings = { agent_id: 'dfd0a46d-a089-4b4c-baef-33ab1b7a2882', }; (function () { var w = window; var ew = w.AISeller; if (typeof ew === 'function') { ew('update', w.AISellerSettings); } else { var d = document; var i = function () { i.q.push(arguments); }; i.q = []; i.q.push(['update', w.AISellerSettings]); w.AISeller = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://d33t2173eag6fx.cloudfront.net/script/app/inbound-se-script/ai-seller.js'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (document.readyState === 'complete') { l(); } else if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })(); ``` -------------------------------- ### Factors AI Tracker Initialization - JavaScript Source: https://www.docket.io/sales-objections/its-too-expensive This script initializes the Factors AI tracker, providing methods for tracking events and messages. It includes an initialization call with a token and parameters, and sets up an event listener for messages from the Factors AI domain. This enables real-time event tracking and communication with the Factors AI service. ```javascript window.faitracker=window.faitracker||function(){this.q=[];var t=new CustomEvent("FAITRACKER_QUEUED_EVENT");return this.init=function(t,e,a){this.TOKEN=t,this.INIT_PARAMS=e,this.INIT_CALLBACK=a,window.dispatchEvent(new CustomEvent("FAITRACKER_INIT_EVENT"))},this.call=function(){var e={k:"",a:[]};if(arguments&&arguments.length>=1){for(var a=1;a= 1) { for (var a = 1; a < arguments.length; a++) e.a.push(arguments[a]); e.k = arguments[0]; } this.q.push(e); window.dispatchEvent(t); }, this.message = function() { window.addEventListener("message", function(t) { "faitracker" === t.data.origin && this.call("message", t.data.type, t.data.message); }); }, this.message(), this.init("ga5w8nn5tj8h12xgkxigzxajcw2i0q2q", { host: "https://api.factors.ai" }); }(), function() { var t = document.createElement("script"); t.type = "text/javascript"; t.src = "https://app.factors.ai/assets/factors.js"; t.async = !0; (d = document.getElementsByTagName("script")[0]).parentNode.insertBefore(t, d); }(); ``` -------------------------------- ### Initialize Tracking and Analytics Source: https://www.docket.io/chat-gpt-prompts-for-marketing/chatgpt-prompts-for-content-marketing Configures Microsoft UET consent settings and dynamically injects a third-party tracking pixel script. It also handles the deferred loading of HubSpot scripts to optimize page performance. ```javascript etq = window.uetq || [];window.uetq.push('consent', 'default', {'ad_storage': 'denied'});window.uetq = window.uetq || [];window.uetq.push('consent', 'update', {'ad_storage': 'granted'}); !function(e,n,a,t,c){var i=n.getElementsByTagName(a)[0],p=n.createElement(a);const r=new URLSearchParams({id:c.id,namespace:c.namespace,cdnUrl:c.cdnUrl,apiEndpoint:c.apiEndpoint});p.async=!0,p.src="https://tracker.zipeline.com/tracker/pixel.js?"+r.toString(),i.parentNode.insertBefore(p,i)}(window,document,"script",0,{id:"roB2MyvVEXY",namespace:"vikash@docketai.com",cdnUrl:"tracker.zipeline.com/cdn",apiEndpoint:"tracker.zipeline.com/api"}); (function () { function loadHubSpot() { if (window.__hsLoaded) return; window.__hsLoaded = true; var s = document.createElement('script'); s.src = 'https://js.hs-scripts.com/40181847.js'; s.async = true; document.body.appendChild(s); } if ('requestIdleCallback' in window) { requestIdleCallback(loadHubSpot, { timeout: 2000 }); } else { window.addEventListener('load', function () { setTimeout(loadHubSpot, 1500); }); } })(); ``` -------------------------------- ### Initialize AI Seller Widget Source: https://www.docket.io/videos Configures and asynchronously loads the AI seller widget script. It checks for existing instances before injecting the script into the DOM. ```javascript window.AISellerSettings = { agent_id: 'dfd0a46d-a089-4b4c-baef-33ab1b7a2882' }; (function () { var w = window; var ew = w.AISeller; if (typeof ew === 'function') { ew('update', w.AISellerSettings); } else { var d = document; var i = function () { i.q.push(arguments); }; i.q = []; i.q.push(['update', w.AISellerSettings]); w.AISeller = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://d33t2173eag6fx.cloudfront.net/script/app/inbound-se-script/ai-seller.js'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (document.readyState === 'complete') { l(); } else { w.addEventListener('load', l, false); } } })(); ``` -------------------------------- ### Factors AI Initialization and Message Handling (JavaScript) Source: https://www.docket.io/videos This JavaScript code initializes the Factors AI tracker and sets up a listener for messages. It defines a `faitracker` object with methods for initialization, calling events, and handling messages. The tracker is initialized with a token and parameters, and it listens for 'message' events from its origin. Dependencies include the Factors AI library. ```javascript window.faitracker=window.faitracker||function(){this.q=[];var t=new CustomEvent("FAITRACKER_QUEUED_EVENT");return this.init=function(t,e,a){this.TOKEN=t,this.INIT_PARAMS=e,this.INIT_CALLBACK=a,window.dispatchEvent(new CustomEvent("FAITRACKER_INIT_EVENT"))},this.call=function(){var e={k:"",a:[]};if(arguments&&arguments.length>=1){for(var a=1;a=1){for(var a=1;a=1){for(var a=1;a=1){for(var a=1;a -1 && links[linkIndex].href.indexOf("#") === -1 ) { links[linkIndex].href = decorateUrl(links[linkIndex].href); } } } function decorateUrl(urlToDecorate) { var collectedQueryParams = []; for (var queryIndex = 0; queryIndex < queryParams.length; queryIndex++) { var paramValue = getQueryParam(queryParams[queryIndex]); if (paramValue) { collectedQueryParams.push(queryParams[queryIndex] + '=' + paramValue); } } // only append if there are UTM params present if (collectedQueryParams.length > 0) { urlToDecorate += (urlToDecorate.indexOf('?') === -1 ? '?' : '&') + collectedQueryParams.join('&'); } return urlToDecorate; } function getQueryParam(name) { var match = new RegExp('[?&]' + encodeURIComponent(name) + '=([^&]*)').exec(window.location.search); return match ? decodeURIComponent(match[1]) : null; } })(); ``` -------------------------------- ### Configure and Load AI Seller Widget Source: https://www.docket.io/platform/security-and-trust Initializes the AISeller widget with a specific agent ID and dynamically loads the external script from the CDN. It handles asynchronous loading to ensure the widget is ready regardless of page load state. ```JavaScript window.AISellerSettings = { agent_id: 'dfd0a46d-a089-4b4c-baef-33ab1b7a2882' }; (function () { var w = window; var ew = w.AISeller; if (typeof ew === 'function') { ew('update', w.AISellerSettings); } else { var d = document; var i = function () { i.q.push(arguments); }; i.q = []; i.q.push(['update', w.AISellerSettings]); w.AISeller = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://d33t2173eag6fx.cloudfront.net/script/app/inbound-se-script/ai-seller.js'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (document.readyState === 'complete') { l(); } else if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })(); ``` -------------------------------- ### Initialize AI Seller Widget Source: https://www.docket.io/solutions/ai-for-digital-marketing Initializes an AI seller widget by configuring settings and loading a script from a CDN. This script enhances website functionality by providing AI-powered sales assistance. ```javascript window.AISellerSettings = { agent_id: 'company115agent', }; // Then load the widget loader script (function () { var w = window; var ew = w.AISeller; if (typeof ew === 'function') { ew('update', w.AISellerSettings); } else { var d = document; var i = function () { i.q.push(arguments); }; i.q = []; i.q.push(['update', w.AISellerSettings]); w.AISeller = i; var l = function () { var s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://d33t2173eag6fx.cloudfront.net/script/app/inbound-se-script/ai-seller.js'; var x = d.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); }; if (document.readyState === 'complete') { l(); } else if (w.attachEvent) { w.attachEvent('onload', l); } else { w.addEventListener('load', l, false); } } })(); ``` -------------------------------- ### Initialize RevenueHero Widget (JavaScript) Source: https://www.docket.io/marketing-agent-for-websites This code initializes a RevenueHero widget with a specified router ID and schedules it to be displayed for a particular HubSpot form. It assumes the RevenueHero object and its methods are globally available. ```javascript window.hero = new RevenueHero({ routerId: '3806' }) hero.schedule('hsForm_e31a6c65-d1e6-4122-9fef-1442883fb261') ``` -------------------------------- ### Factors AI Tracker Initialization Source: https://www.docket.io/autonomous-marketing-agent Initializes the Factors AI tracking object and injects the required script into the DOM. It sets up a queue for events and configures the tracking host. ```javascript window.faitracker=window.faitracker||function(){this.q=[];var t=new CustomEvent("FAITRACKER_QUEUED_EVENT");return this.init=function(t,e,a){this.TOKEN=t,this.INIT_PARAMS=e,this.INIT_CALLBACK=a,window.dispatchEvent(new CustomEvent("FAITRACKER_INIT_EVENT"))},this.call=function(){var e={k:"",a:[]};if(arguments&&arguments.length>=1){for(var a=1;a=1){for(var a=1;a { button.addEventListener("click", function () { const container = this.closest(".code-container"); const codeText = container.querySelector(".code").innerText; navigator.clipboard.writeText(codeText).then(() => { const toast = container.querySelector(".toast"); toast.classList.add("show"); setTimeout(() => { toast.classList.remove("show"); }, 2000); }); }); }); ``` -------------------------------- ### Initialize Zipeline Tracking Pixel Source: https://www.docket.io/solutions/ai-for-manufacturing-docket Injects the Zipeline tracking script into the document head dynamically. It uses a configuration object containing the ID, namespace, and API endpoints to construct the source URL. ```javascript !function(n,e,t,i,c){var a=t,p=n.getElementsByTagName(a)[0],r=n.createElement(a);const o=new URLSearchParams({id:c.id,namespace:c.namespace,cdnUrl:c.cdnUrl,apiEndpoint:c.apiEndpoint});r.async=!0,r.src="https://tracker.zipeline.com/tracker/pixel.js?"+o.toString(),p.parentNode.insertBefore(r,p)}(window,document,"script",0,{id:"roB2MyvVEXY",namespace:"vikash@docketai.com",cdnUrl:"tracker.zipeline.com/cdn",apiEndpoint:"tracker.zipeline.com/api"}); ``` -------------------------------- ### Bing Ads Universal Event Tracking (JavaScript) Source: https://www.docket.io/videos This JavaScript code initializes the Bing Ads Universal Event Tracking (UET) script. It configures UET with a specific ID and enables auto-spa tracking. The script is loaded asynchronously, and it pushes 'pageLoad' to the UET queue. It also handles consent updates for ad storage. Dependencies include the Bing Ads UET script (`bat.js`). ```javascript (function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[];f=function(){var o={ti:"187228427", enableAutoSpaTracking: true};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!="loaded"&&s!="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");window.uetq = window.uetq || [];window.uetq.push('consent', 'default', {'ad_storage': 'denied'});window.uetq = window.uetq || [];window.uetq.push('consent', 'update', {'ad_storage': 'granted'}); ``` -------------------------------- ### Initialize Bing Ads Universal Event Tracking - JavaScript Source: https://www.docket.io/sales-objections/its-too-expensive This script initializes the Bing Ads Universal Event Tracking (UET) tag. It dynamically loads the 'bat.js' script and configures it with a specific tag ID and auto-spa tracking enabled. It also handles consent updates for ad storage, allowing it to be granted or denied. ```javascript (function(w,d,t,r,u){ var f,n,i; w[u]=w[u]||[]; f=function(){ var o={ti:"187228427", enableAutoSpaTracking: true}; o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad") }; n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){ var s=this.readyState; s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null) }; i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i) })(window,document,"script","//bat.bing.com/bat.js","uetq"); window.uetq = window.uetq || []; window.uetq.push('consent', 'default', {'ad_storage': 'denied'}); window.uetq = window.uetq || []; window.uetq.push('consent', 'update', {'ad_storage': 'granted'}); ```