@bytebrand/fe-ui-core 4.1.203 → 4.1.204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -537,6 +537,7 @@ export function setUtmParameters() {
|
|
|
537
537
|
|
|
538
538
|
export const updateCookieList = () => {
|
|
539
539
|
let cookieConsentList = Object.keys(GOOGLE_BUNDLE_COOKIES);
|
|
540
|
+
let isHomeGoogleGranted = true; // home page google cookie
|
|
540
541
|
let isFBGranted = true;
|
|
541
542
|
let isHotjarGranted = true;
|
|
542
543
|
const cookieConfig = JSON.parse(localStorage.getItem('cookieConfig')) || {};
|
|
@@ -547,7 +548,10 @@ export const updateCookieList = () => {
|
|
|
547
548
|
cookieConfig[group].forEach((cookie: string) => {
|
|
548
549
|
Cookies.remove(cookie, { domain, path: '/' }); // manually remove selected cookies
|
|
549
550
|
// google
|
|
550
|
-
if (cookieConsentList.includes(cookie))
|
|
551
|
+
if (cookieConsentList.includes(cookie)) {
|
|
552
|
+
cookieConsentList = cookieConsentList.filter(i => i !== cookie); // deny google cookie consent for _gcl_au, _ga, _gid, _gat_UA-31842-13, etc
|
|
553
|
+
isHomeGoogleGranted = false;
|
|
554
|
+
}
|
|
551
555
|
// fb
|
|
552
556
|
// tslint:disable-next-line:prefer-switch
|
|
553
557
|
else if (cookie === '_fbp') isFBGranted = false;
|
|
@@ -556,6 +560,7 @@ export const updateCookieList = () => {
|
|
|
556
560
|
});
|
|
557
561
|
// grant google cookies
|
|
558
562
|
if (typeof window.grantCookieConsent === 'function') window.grantCookieConsent(cookieConsentList);
|
|
563
|
+
if (isHomeGoogleGranted && typeof window.allowGoogle === 'function') window.allowGoogle();
|
|
559
564
|
// grant FB cookies
|
|
560
565
|
if (isFBGranted && typeof window.fbq === 'function') window.fbq('consent', 'grant');
|
|
561
566
|
// grant Hotjar cookies
|