GQ SHOP 網路男性時尚與品味購物的朝聖地 [v-cloak] { display: none; } (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-MS9N8J'); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-P3HX446F'); // ====== Fides helper functions ======= const fidesOtKeyEquivalencies = [ ['essential', 'C0001'], ['analytics', 'C0002'], ['functional', 'C0003'], ['sales_sharing_targeted_advertising', 'C0004'], ['social_media', 'C0005'], ['audience_measurement', 'C0009'], ]; const toReverseEquivalency = ([key, value]) => [value, key]; const bannerComponents = ['tcf_banner', 'banner']; const wasFidesBannerShownGtmEvent = (event) => event?.type === 'FidesUIShown' && bannerComponents.includes(event.detail.extraDetails.servingComponent); const fidesExtractConsentGroupsAsOtArray = () => { const consented = (consentKey) => { let keys = consentKey; if (typeof consentKey === 'string') { keys = [consentKey]; } const fidesInitialized = window.Fides?.initialized ?? false; const consentFlagIsTrue = (value) => value; const fidesDefaultConsent = { essential: true }; const toConsentFlags = (k) => (window.Fides?.consent ?? fidesDefaultConsent)[k] ?? fidesInitialized; return keys.map(toConsentFlags).every(consentFlagIsTrue); }; const otConsentCategories = []; const pushIfConsented = (otCategory, fidesKeys) => { if (consented(fidesKeys)) { otConsentCategories.push(otCategory); } }; fidesOtKeyEquivalencies .map(toReverseEquivalency) .forEach(([otKey, fidesKey]) => pushIfConsented(otKey, fidesKey)); return otConsentCategories; }; const consentPreferencesMapping = (event) => { if (event.type === 'FidesUpdated') { const lastFidesUIShownEvent = findLastdataLayerEvent('FidesUIShown'); let methodMap = {}; console.log("****lastFidesUIShownEvent", lastFidesUIShownEvent?.Fides?.extraDetails?.servingComponent) if ( lastFidesUIShownEvent?.Fides?.extraDetails?.servingComponent?.endsWith( 'banner' ) ?? false ) { methodMap = { reject: 'Banner Reject All', accept: 'Banner Accept Cookies' }; } else { methodMap = { reject: 'Preferences Reject All', save: 'Preferences Save Settings', accept: 'Preferences Allow All' }; } const consentMethod = event?.detail?.extraDetails?.consentMethod; const eventLabel = methodMap[consentMethod] || null; const consentGroups = fidesExtractConsentGroupsAsOtArray() trackConsentPreferences(consentGroups, eventLabel); } }; //===== end of fides helper functions ===== //========== snowplow script injection ======== (function (p, l, o, w, i, n, g) { if (!p[i]) { p.GlobalSnowplowNamespace = p.GlobalSnowplowNamespace || []; p.GlobalSnowplowNamespace.push(i); p[i] = function () { (p[i].q = p[i].q || []).push(arguments) }; p[i].q = p[i].q || []; n = l.createElement(o); g = l.getElementsByTagName(o)[0]; n.async = 1; n.src = w; g.parentNode.insertBefore(n, g) } }(window, document, "script", "https://globalservices.conde.digital/p77xzrbz9z.js", "snowplowCN")); //========== snowplow initial config =========== document.addEventListener('DOMContentLoaded', function () { setupConsentObserver(); }); function setupConsentObserver() { let snowplowInitialized = false; const observer = new MutationObserver(() => { if (window.Fides || window.OnetrustActiveGroups) { const consentGroups = getConsentGroups?.() || []; console.log("******consentGroups", consentGroups) if (consentGroups.length && !snowplowInitialized) { snowplowInitialized = true; console.log('**** Snowplow initialized'); window.snowplowCN(function () { const snowplowConfig = { appId: 'gq-tw-shop', contexts: { performanceTiming: true, clientHints: true, webVitals: true, }, anonymousTracking: { withSessionTracking: true, withServerAnonymisation: true, }, stateStorageStrategy: 'cookieAndLocalStorage', discoverRootDomain: true, cookieSameSite: window.location.protocol === 'https:' ? 'None' : 'Lax', cookieSecure: window.location.protocol === 'https:', eventMethod: 'post', postPath: '/com.condenast/yv8', }; const consentGroups = getConsentGroups() const anonymousConfig = consentGroups.includes('C0004') ? { anonymousTracking: false, stateStorageStrategy: 'cookieAndLocalStorage' } : {}; // app Id and collector URL needs to be altered as per the domain snowplowCN('newTracker', 'sp', 'https://c.gq.com.tw', { ...snowplowConfig, ...anonymousConfig }); const pagePlugin = { pageTitle: () => { return { beforeTrack: (payloadBuilder) => { payloadBuilder.add('page', window?.document?.title); payloadBuilder.build(); } }; } }; snowplowCN('addPlugin', pagePlugin, 'pageTitle'); snowplow
FACT BOX ・ 要点整理
- 出典:PR Times
- 分類:ニュース
- 関連組織:Google
- 製品・サービス:GQ SHOP