|
1 | 1 | {{#with site.keys.segment}} |
2 | 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 | | -}}(); |
| 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 | +</script> |
| 5 | +<script src="https://consent.trustarc.com/get?name=trustarc-segment-wrapper-v1.1.js" async></script> |
| 6 | +<script> |
| 7 | +(function() { |
| 8 | + function initSegmentWithTrustArc() { |
| 9 | + if (typeof TrustArcWrapper !== 'undefined' && window.analytics) { |
| 10 | + TrustArcWrapper.withTrustArc(window.analytics).load('{{this}}'); |
| 11 | + } else { |
| 12 | + setTimeout(initSegmentWithTrustArc, 100); |
| 13 | + } |
| 14 | + } |
| 15 | + initSegmentWithTrustArc(); |
| 16 | +})(); |
6 | 17 | </script> |
7 | 18 | {{/with}} |
8 | 19 |
|
9 | 20 | {{#with site.keys.ibmAnalyticsEnabled}} |
| 21 | +<script> |
| 22 | +/* eslint-disable */ |
| 23 | +// IBM Segment Common Properties - Required for all events |
| 24 | +const SEGMENT_COMMON_PROPERTIES = { |
| 25 | + productTitle: '<ADD>', |
| 26 | + productCode: '<ADD>', |
| 27 | + productCodeType: '<ADD>', |
| 28 | + ut30: '<ADD>' |
| 29 | +}; |
| 30 | +
|
| 31 | +// IBM Analytics Configuration |
| 32 | +window._ibmAnalytics = { |
| 33 | + "settings": { |
| 34 | + "name": "DataStax", |
| 35 | + "tealiumProfileName": "ibm-subsidiary", |
| 36 | + }, |
| 37 | + "trustarc": { |
| 38 | + "privacyPolicyLink": "https://ibm.com/privacy" |
| 39 | + }, |
| 40 | + "digitalData.page.services.google.enabled": true |
| 41 | +}; |
| 42 | +
|
| 43 | +window.digitalData = { |
| 44 | + "page": { |
| 45 | + "pageInfo": { |
| 46 | + "ibm": { |
| 47 | + "siteId": "IBM_" + _ibmAnalytics.settings.name, |
| 48 | + }, |
| 49 | + "segment": { |
| 50 | + "enabled": true, |
| 51 | + "env": "prod", |
| 52 | + "coremetrics": false, |
| 53 | + "carbonComponentEvents": false, |
| 54 | + "commonProperties": SEGMENT_COMMON_PROPERTIES |
| 55 | + } |
| 56 | + }, |
| 57 | + "category": { |
| 58 | + "primaryCategory": "PC230" |
| 59 | + } |
| 60 | + } |
| 61 | +}; |
| 62 | +
|
| 63 | +// Google Consent Mode v2 - Set defaults before Google tags load |
| 64 | +window.dataLayer = window.dataLayer || []; |
| 65 | +function gtag(){dataLayer.push(arguments);} |
| 66 | +
|
| 67 | +// Set default consent to denied |
| 68 | +gtag('consent', 'default', { |
| 69 | + 'ad_storage': 'denied', |
| 70 | + 'ad_user_data': 'denied', |
| 71 | + 'ad_personalization': 'denied', |
| 72 | + 'analytics_storage': 'denied' |
| 73 | +}); |
| 74 | +
|
| 75 | +// TrustArc Consent Update Listener for Google Consent Mode |
| 76 | +(function() { |
| 77 | + function updateGoogleConsent() { |
| 78 | + if (typeof window.truste !== 'undefined' && window.truste.cma) { |
| 79 | + var consent = window.truste.cma.callApi('getConsent', window.location.href) || {}; |
| 80 | +
|
| 81 | + // Map TrustArc categories to Google consent types |
| 82 | + // Category 0 = Required, 1 = Functional, 2 = Advertising, 3 = Analytics |
| 83 | + var hasAdvertising = consent[2] === 1; |
| 84 | + var hasAnalytics = consent[3] === 1; |
| 85 | +
|
| 86 | + gtag('consent', 'update', { |
| 87 | + 'ad_storage': hasAdvertising ? 'granted' : 'denied', |
| 88 | + 'ad_user_data': hasAdvertising ? 'granted' : 'denied', |
| 89 | + 'ad_personalization': hasAdvertising ? 'granted' : 'denied', |
| 90 | + 'analytics_storage': hasAnalytics ? 'granted' : 'denied' |
| 91 | + }); |
| 92 | + } |
| 93 | + } |
| 94 | +
|
| 95 | + // Listen for consent changes |
| 96 | + if (window.addEventListener) { |
| 97 | + window.addEventListener('cm_data_subject_consent_changed', updateGoogleConsent); |
| 98 | + window.addEventListener('cm_consent_preferences_set', updateGoogleConsent); |
| 99 | + } |
| 100 | +
|
| 101 | + // Initial check after TrustArc loads |
| 102 | + if (document.readyState === 'complete') { |
| 103 | + updateGoogleConsent(); |
| 104 | + } else { |
| 105 | + window.addEventListener('load', updateGoogleConsent); |
| 106 | + } |
| 107 | +})(); |
| 108 | +</script> |
10 | 109 | <script src="//1.www.s81c.com/common/stats/ibm-common.js" type="text/javascript" async="async"></script> |
11 | 110 | {{/with}} |
12 | 111 |
|
|
0 commit comments