Skip to content

Commit b3f4527

Browse files
authored
Merge pull request #49 from TheCodeRaccoons/Updates-to-CMS-Filter
Updates to cms filter
2 parents c1a3905 + f5fd7fe commit b3f4527

3 files changed

Lines changed: 637 additions & 256 deletions

File tree

Dist/Functional/CookieConsent.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ class CookieConsent {
116116
.filter(Boolean);
117117
}
118118

119+
// Handle Facebook pixel consent if analytics or all is accepted
120+
if (consentCategories.includes('all') || consentCategories.includes('analytics')) {
121+
window.localStorage.setItem('fbGrantConsent', 'true');
122+
if (typeof window.fbq === 'function') {
123+
window.fbq('consent', 'grant');
124+
}
125+
}
126+
119127
const consentScripts = document.querySelectorAll('script[wt-cookieconsent-script]');
120128
consentScripts.forEach(originalScript => {
121129
const scriptCategory = originalScript.getAttribute('wt-cookieconsent-script');

0 commit comments

Comments
 (0)