Skip to content

Commit b303e1a

Browse files
committed
Fix cookie consent banner customize tab options being ignored when clicking on 'Save selection'
Incident: https://balena.fibery.io/Security/Information_Security_and_Reliability_Incident/Cookie-consent-tracking-enabled-after-rejection-in-the-'customize'-tab-of-the-cookie-consent-banner-110 Change-type: patch
1 parent 0decc11 commit b303e1a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

templates/_track.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@
8888
},
8989
})
9090

91-
cc.on('accept', () => {
92-
addAnalyticsClient();
93-
gtag('consent', 'update', {
94-
'analytics_storage': 'granted'
95-
});
91+
cc.on('accept', (cc) => {
92+
if (cc.acceptedCategories?.includes('analytics')) {
93+
addAnalyticsClient();
94+
gtag('consent', 'update', {
95+
'analytics_storage': 'granted',
96+
});
97+
}
9698
});
9799
}
98100

0 commit comments

Comments
 (0)