Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

CheckoutStep and orderComplete is set to early

$
0
0

Replies: 0

Hello,

Is there any way to delay when gtm4wp.checkoutStepEEC and gtm4wp.orderCompleted is set in the dataLayer?

The problem occurs because I’m using the CookieYes plugin for cookie banner. During the acceptance of, for example, Analytics cookies the cookie banner loads

<script>
 window.dataLayer = window.dataLayer || [];
 function gtag() {window.dataLayer.push(arguments);}
 gtag('consent', 'update', {'ad_storage': 'granted'});
 window.dataLayer.push({
 'event': 'cookieConsentAdvertisement',
 'cookieConsentAdvertisement': true
 });
 console.log("Consent Mode Advertisement WP set")
</script>

The cookieConsentAdvertisement flags are set to be able to trigger/not trigger tags based on if they accepted analytics cookies (true) or not (false). But the problem is that gtm4wp.checkoutStepEEC and gtm4wp.orderCompleted is being called before the CookieYes loads the scripts which creates it being false, even though it should be set to true.

Is there anyway way to delay the trigger of GTM4WPs dataLayer events?

  • This topic was modified 5 minutes ago by joeoak.

Viewing all articles
Browse latest Browse all 59525

Trending Articles