fix consent check

This commit is contained in:
SteVen Batten 2021-08-30 09:03:40 -07:00
parent ce8cc7ec90
commit 0dce41ef87

View file

@ -11,16 +11,11 @@ function loadAnalytics(gtag) {
}
function onConsentChanged() {
if (!consentRequired()) {
return;
}
function gtag() {
window.dataLayer.push(arguments)
}
// Where we would handle non-essential cookies in the future
if (WcpConsent.siteConsent.getConsentFor(WcpConsent.consentCategories.Analytics)) {
if (!consentRequired() || WcpConsent.siteConsent.getConsentFor(WcpConsent.consentCategories.Analytics)) {
// Load GA
loadAnalytics(gtag)
}