Skip to content

Commit 95bf9dd

Browse files
committed
Update: added facebook pixel integration as of Webflow's pixel requirements
1 parent 4801d26 commit 95bf9dd

1 file changed

Lines changed: 8 additions & 0 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)