diff --git a/metadata.yaml b/metadata.yaml index 15e0e0b..d7a6f06 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,5 +1,7 @@ homepage: 'https://stape.io/' versions: + - sha: 90497724ccbb843c8f0547dc31c54957d41bbe2b + changeNotes: Fix consent settings. - sha: b44ac56b2e4066c4a8c47922b63a88e82d73fe9b changeNotes: Add support for multiple Pixel IDs and API Access Tokens - sha: eddabe8e81fef2235bcdd9c5d38e2a2a714ec681 diff --git a/template.js b/template.js index be4c9e5..7dd56a0 100644 --- a/template.js +++ b/template.js @@ -633,8 +633,8 @@ function normalizePhoneNumber(phoneNumber) { function isConsentGivenOrNotRequired() { if (data.adStorageConsent !== 'required') return true; if (eventData.consent_state) return !!eventData.consent_state.ad_storage; - const xGaGcs = getRequestHeader('x-ga-gcs') || ''; // x-ga-gcs is a string like "G110" - return xGaGcs[3] === '1'; + const xGaGcs = eventData['x-ga-gcs'] || ''; // x-ga-gcs is a string like "G110" + return xGaGcs[2] === '1'; } function determinateIsLoggingEnabled() { diff --git a/template.tpl b/template.tpl index ca4a0b0..ca08395 100644 --- a/template.tpl +++ b/template.tpl @@ -1361,8 +1361,8 @@ function normalizePhoneNumber(phoneNumber) { function isConsentGivenOrNotRequired() { if (data.adStorageConsent !== 'required') return true; if (eventData.consent_state) return !!eventData.consent_state.ad_storage; - const xGaGcs = getRequestHeader('x-ga-gcs') || ''; // x-ga-gcs is a string like "G110" - return xGaGcs[3] === '1'; + const xGaGcs = eventData['x-ga-gcs'] || ''; // x-ga-gcs is a string like "G110" + return xGaGcs[2] === '1'; } function determinateIsLoggingEnabled() { @@ -1721,21 +1721,6 @@ ___SERVER_PERMISSIONS___ "string": "referer" } ] - }, - { - "type": 3, - "mapKey": [ - { - "type": 1, - "string": "headerName" - } - ], - "mapValue": [ - { - "type": 1, - "string": "x-ga-gcs" - } - ] } ] }