|
1 | 1 | {{#with site.keys.segment}}
|
2 |
| - <script> |
3 |
| - !function(){var i="analytics",analytics=window[i]=window[i]||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"];analytics.factory=function(e){return function(){if(window[i].initialized)return window[i][e].apply(window[i],arguments);var n=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(e)>-1){var c=document.querySelector("link[rel='canonical']");n.push({__t:"bpc",c:c&&c.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}n.unshift(e);analytics.push(n);return analytics}};for(var n=0;n<analytics.methods.length;n++){var key=analytics.methods[n];analytics[key]=analytics.factory(key)}analytics.load=function(key,n){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.setAttribute("data-global-segment-analytics-key",i);t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r);analytics._loadOptions=n};analytics._writeKey="{{this}}";;analytics.SNIPPET_VERSION="5.2.1"; |
4 |
| - analytics.load("{{this}}"); |
5 |
| - analytics.page(); |
6 |
| - }}(); |
7 |
| - </script> |
| 2 | +<script> |
| 3 | +!function(){var i="analytics",analytics=window[i]=window[i]||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"];analytics.factory=function(e){return function(){if(window[i].initialized)return window[i][e].apply(window[i],arguments);var n=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(e)>-1){var c=document.querySelector("link[rel='canonical']");n.push({__t:"bpc",c:c&&c.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}n.unshift(e);analytics.push(n);return analytics}};for(var n=0;n<analytics.methods.length;n++){var key=analytics.methods[n];analytics[key]=analytics.factory(key)}analytics.load=function(key,n){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.setAttribute("data-global-segment-analytics-key",i);t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r);analytics._loadOptions=n};analytics._writeKey="{{this}}";;analytics.SNIPPET_VERSION="5.2.1"; |
| 4 | +analytics.page(); |
| 5 | +}}(); |
| 6 | +</script> |
| 7 | +{{/with}} |
| 8 | + |
| 9 | +{{#with site.keys.ketchSmartTagUrl}} |
| 10 | +<script>!function(){window.semaphore=window.semaphore||[],window.ketch=function(){window.semaphore.push(arguments)};var e=document.createElement("script");e.type="text/javascript",e.src="{{this}}",e.defer=e.async=!0,document.getElementsByTagName("head")[0].appendChild(e)}();</script> |
| 11 | +<script> |
| 12 | +if (window.ketch) { |
| 13 | + function saveConsent(consent) { |
| 14 | + window.ketchConsent = consent; |
| 15 | + }; |
| 16 | + window.ketch("on", "consent", (consent) => { |
| 17 | + saveConsent(consent); |
| 18 | + // Only load Segment analytics if the user has consented to analytics |
| 19 | + if (consent?.purposes?.analytics && window.analytics) { |
| 20 | + window.analytics.load("{{../site.keys.segment}}"); |
| 21 | + } |
| 22 | + }); |
| 23 | + window.ketch("on", "userConsentUpdated", saveConsent); |
| 24 | + window.ketch("on", "regionInfo", regionInfo => { |
| 25 | + var customTextRegions = ["US-CA"]; |
| 26 | + if (customTextRegions.includes(regionInfo)) { |
| 27 | + var preferenceCenterLinkElement = document.getElementById("preferenceCenterLink"); |
| 28 | + preferenceCenterLinkElement.textContent = "Do Not Sell My Personal Information"; |
| 29 | + } |
| 30 | + }) |
| 31 | +} |
| 32 | +</script> |
8 | 33 | {{/with}}
|
9 | 34 |
|
10 | 35 | <script>var uiRootPath = '{{{uiRootPath}}}'</script>
|
|
0 commit comments