mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-09 10:54:11 -04:00
Clear old cookies to be based on consent
We have been clearing all the Google Analytics cookies on each page request. It is now possible for a user to consent to having Google Analytics cookies so this should have been checking for that before deleting them. This makes that change, with tests for those scenarios.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
window.GOVUK.Frontend.initAll();
|
||||
|
||||
window.GOVUK.Modules.CookieBanner.clearOldCookies();
|
||||
var consentData = window.GOVUK.getConsentCookie();
|
||||
window.GOVUK.Modules.CookieBanner.clearOldCookies(consentData);
|
||||
|
||||
if (window.GOVUK.hasConsentFor('analytics')) {
|
||||
if (window.GOVUK.hasConsentFor('analytics', consentData)) {
|
||||
window.GOVUK.initAnalytics();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user