@bytebrand/fe-ui-core 4.2.47 → 4.2.48
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
|
@@ -539,7 +539,6 @@ export function setUtmParameters() {
|
|
|
539
539
|
export const updateCookieList = () => {
|
|
540
540
|
let cookieConsentList = Object.keys(GOOGLE_BUNDLE_COOKIES);
|
|
541
541
|
let isHomeGoogleGranted = true; // home page google cookie
|
|
542
|
-
let isFBGranted = true;
|
|
543
542
|
let isHotjarGranted = true;
|
|
544
543
|
const cookieConfig = JSON.parse(localStorage.getItem('cookieConfig')) || {};
|
|
545
544
|
|
|
@@ -552,16 +551,17 @@ export const updateCookieList = () => {
|
|
|
552
551
|
if (cookieConsentList.includes(cookie)) {
|
|
553
552
|
cookieConsentList = cookieConsentList.filter(i => i !== cookie); // deny google cookie consent for _gcl_au, _ga, _gid, _gat_UA-31842-13, etc
|
|
554
553
|
isHomeGoogleGranted = false;
|
|
555
|
-
} else if (cookie === '_fbp') { // tslint:disable-line
|
|
556
|
-
isFBGranted = false;
|
|
557
554
|
} else if (cookie === 'hotjar') isHotjarGranted = false;
|
|
558
555
|
});
|
|
559
556
|
});
|
|
560
557
|
// grant google cookies
|
|
561
558
|
if (typeof window.grantCookieConsent === 'function') window.grantCookieConsent(cookieConsentList);
|
|
562
|
-
if (isHomeGoogleGranted && typeof window.allowGoogle === 'function')
|
|
563
|
-
|
|
564
|
-
|
|
559
|
+
if (isHomeGoogleGranted && typeof window.allowGoogle === 'function') {
|
|
560
|
+
window.allowGoogle();
|
|
561
|
+
// grant FB cookies
|
|
562
|
+
window.fbq('consent', 'grant');
|
|
563
|
+
}
|
|
564
|
+
|
|
565
565
|
// grant Hotjar cookies
|
|
566
566
|
if (isHotjarGranted && typeof window.grantHotjarCookieConsent === 'function') window.grantHotjarCookieConsent();
|
|
567
567
|
};
|