PageSourceSearch

https://www.battery.com/wp-content/plugins/webtoffee-cookie-consent/lite/frontend/js/gcm.min.js?ver=3.5.5

js battery.com collected 2026-09-24 08:56:54 UTC 7,630 bytes, 1 lines download raw bytes

1!function(){const data=window._wccGCMConfig;let setDefaultSetting=!0;const regionSettings=data._regions||[],waitForTime=data.wait_for_update,wcc_bypass=!!data._wccBypass,wcc_gcm_debug=!!data._debugMode,is_gtm_template=!!data._isGTMTemplate;function gtag(){dataLayer.push(arguments)}function setConsentInitStates(consentData){waitForTime>0&&(consentData.wait_for_update=waitForTime),gtag("consent","default",consentData)}if(window.dataLayer=window.dataLayer||[],is_gtm_template||gtag("set","developer_id.dZDk4Nz",!0),"advanced"!==data._mode||is_gtm_template||gtag("set","url_passthrough",!!data._urlPassthrough),!is_gtm_template)if(regionSettings.length)for(let index=0;index<regionSettings.length;index++){const regionSetting=regionSettings[index],convertConsent=value=>"Allowed"===value||"Granted"===value?"granted":"denied",consentRegionData={ad_storage:convertConsent(regionSetting.ad_storage),analytics_storage:convertConsent(regionSetting.analytics_storage),functionality_storage:convertConsent(regionSetting.functionality_storage),personalization_storage:convertConsent(regionSetting.personalization_storage),security_storage:convertConsent(regionSetting.security_storage),ad_user_data:convertConsent(regionSetting.ad_user_data),ad_personalization:convertConsent(regionSetting.ad_personalization)};let regionsToSetFor=[];Array.isArray(regionSetting.region)?regionsToSetFor=regionSetting.region.map(region=>region.trim()):"string"==typeof regionSetting.region&&(regionsToSetFor=regionSetting.region.split(",").map(region=>region.trim()).filter(region=>region)),regionsToSetFor.length>0&&"all"!==regionsToSetFor[0].toLowerCase()?consentRegionData.region=regionsToSetFor:(setDefaultSetting=!1,setDefaultConsents()),setConsentInitStates(consentRegionData)}else setDefaultConsents();function setDefaultConsents(){setDefaultSetting&&setConsentInitStates({ad_storage:"denied",analytics_storage:"denied",functionality_storage:"denied",personalization_storage:"denied",security_storage:"granted",ad_user_data:"denied",ad_personalization:"denied"})}function update_consent_status(categories,is_refresh=!1){const categoryMap={advertisement:"wcc_ad_storage",analytics:"wcc_analytics_storage",functional:"wcc_functionality_storage"};Object.keys(categoryMap).forEach(category=>{window[categoryMap[category]]="denied"}),categories.accepted.forEach(category=>{categoryMap[category]&&(window[categoryMap[category]]="granted")}),wcc_bypass&&(Object.keys(categoryMap).forEach(category=>{window[categoryMap[category]]="granted"}),wcc_waiting_period=100),is_refresh&&is_gtm_template||gtag("consent","update",{ad_storage:wcc_ad_storage,ad_user_data:wcc_ad_storage,ad_personalization:wcc_ad_storage,analytics_storage:wcc_analytics_storage,functionality_storage:wcc_functionality_storage,personalization_storage:wcc_functionality_storage,security_storage:"granted"}),("advanced"===data._mode||is_gtm_template)&&function(wcc_ad_storage){if(data._redactData){gtag("set","ads_data_redaction","granted"!==wcc_ad_storage)}}(wcc_ad_storage);const consentUpdateEvent=new CustomEvent("wcc_gcm_updated",{detail:{ad_storage:wcc_ad_storage,analytics_storage:wcc_analytics_storage,functionality_storage:wcc_functionality_storage,personalization_storage:wcc_functionality_storage}});document.dispatchEvent(consentUpdateEvent),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"wcc_gcm_consent_update",ad_storage:wcc_ad_storage,analytics_storage:wcc_analytics_storage,functionality_storage:wcc_functionality_storage,personalization_storage:wcc_functionality_storage})}function isConsentGiven(){let wcc_consent_exist=getCookieValue("wt_consent","action");return"yes"===wcc_consent_exist||"no"===wcc_consent_exist}function getCookieValue(name,key){const cookies=document.cookie.split(";");for(const cookie of cookies){const[cookieName,cookieValue]=cookie.split("=");if(cookieName.trim()===name){const keyValuePairs=cookieValue.split(",");for(const pair of keyValuePairs){const[pairKey,pairValue]=pair.split(":");if(pairKey.trim()===key)return pairValue.trim()}}}return!1}function setConsentStatus(){function getConsentStatus(status){return void 0===status?"missing":status?"granted":"denied"}function logResolveSteps(){console.group("%cHow to resolve this","font-weight:bold; color:#d97706;"),console.group("%cStep 1 — Check Google Tag Gateway (GTG) status","font-weight:bold;"),console.log("• Are you utilizing Google Tag Gateway?\n  If tags are routed through your own first-party subdomain or injected via a Cloudflare one-click setup, your tracking script order is likely being altered automatically.\n\n• Verify enrollment — Google Tag Gateway (GTG) Verification Guide:\n  https://www.webtoffee.com/docs/gdpr-plugin/how-to-set-up-google-tag-gateway-and-consent-mode/"),console.groupEnd(),console.group("%cStep 2 — Ensure correct consent initialization order","font-weight:bold;"),console.log("• Reserve the ‘Consent Initialization - All Pages’ trigger exclusively for your WebToffee CMP Tag in GTM so it registers first.\n• Ensure all directly loaded hardcoded scripts execute only after your default consent state is set.\n• Open Google Tag Assistant → Tags tab and confirm your tags match user preferences."),console.groupEnd(),console.log("%cNeed help?\n• Reach out via our GCM Support center:\n  https://www.webtoffee.com/gcm-support-center/","font-weight:bold;"),console.groupEnd()}try{if(console.log("Debugging Google Consent Mode:\n"),!window.google_tag_data||!google_tag_data.ics||!google_tag_data.ics.entries)return console.log("%cNo Consent Mode data found","color:#dc2626; font-weight:bold;"),void logResolveSteps();let messageToPrint="";const consentModeData=google_tag_data.ics.entries;let defaultMissing=!1;for(const consentItem in consentModeData){const currentItem=consentModeData[consentItem],defaultValue=getConsentStatus(currentItem.default);messageToPrint=`${messageToPrint}\n\t${consentItem}:\n\t\tDefault: ${defaultValue}\n\t\tUpdate: ${getConsentStatus(currentItem.update)}\n\n`,"missing"===defaultValue&&(defaultMissing=!0)}defaultMissing&&(messageToPrint+="\n\tWarning: Some categories are missing a default value.\n"),google_tag_data.ics.wasSetLate?messageToPrint+="\n\tWarning: A tag read consent before a default was set.\n":messageToPrint+="\n\tConsent mode states were set correctly.",console.log(messageToPrint),(defaultMissing||google_tag_data.ics.wasSetLate)&&logResolveSteps()}catch(error){console.log("%cWarning: Error detecting consent mode status","color:#dc2626; font-weight:bold;"),logResolveSteps()}}document.addEventListener("_wccBannerVisible",function(event){let is_banner_visible=event.detail.bannerVisibility,currentLaw=event.detail.currentLaw,categories={};if(!is_banner_visible||wcc_bypass)categories={accepted:["necessary","functional","analytics","performance","advertisement","others"],rejected:[]};else if(is_banner_visible){let accepted=["necessary"],rejected=[];["functional","analytics","performance","advertisement","others"].forEach(function(category){let cookieValue=getCookieValue("wt_consent",category);"yes"===cookieValue?accepted.push(category):"no"===cookieValue&&rejected.push(category)}),categories={accepted:accepted,rejected:rejected}}(!categories||!isConsentGiven()&&is_banner_visible&&is_gtm_template)&&"CCPA"!==currentLaw||update_consent_status(categories,!0),wcc_gcm_debug&&!is_gtm_template&&setConsentStatus()}),document.addEventListener("wcc_consent_update",function(eventData){const categories=eventData.detail.categories;categories&&isConsentGiven()&&(update_consent_status(categories),wcc_gcm_debug&&!is_gtm_template&&setConsentStatus())})}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.