• Hi Thomas,

    i have a problem with EEC Tracking for GA3/Universal Analytics.
    I had successfully implemented EEC Tracking with your plugin.
    My GA3 Event Tag with EEC fired on Trigger of dataLayer event/push and the EEC data for transaction was successfully reported in GA3.

    Now i have implemented a Consent Manager and therefore it is necessary to check if the consent for GA is given by the user.
    The consent is pushed into a DataLayer variable and could be checked as a condition for a Trigger.
    Unfortunately the consent dataLayer is pushed after DL events “gtm4wp.orderCompletedEEC” and then “purchase” of your plugin are pushed.
    I tried a Trigger Group (with Trigger 1 consentEvent and Trigger 2 “gtm4wp.orderCompletedEEC”) but the EEC data weren’t sent successfully anymore.

    I think that my problem is that after the “gtm4wp.orderCompletedEEC” event for GA3 there is the “purchase” event for GA4 and it pushes a new ecommerce object to the dataLayer.
    According to simoahava.com Tags can only access the most recent ecommerce push. So in my case the Trigger Group would access the GA4 ecommerce push with the wrong parameter names, e.g. “item_id” instead if “id”. The result is, that there is no EEC data sent by my Tag.

    Is there any way to turn compability for GA4 off (e.g. no “purchase” event) or a way to handle the GA3 push in a Trigger Group?

    Thank you very much for your help!
    Christian

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Same issue here. The new GA4 variables seem to conflict. The EEC data is not send with my tags anymore. Also using consent manager.

    Would be great if we can disable the GA4 dataLayer variables.

    <script data-cookieconsent="ignore">
    		window.dataLayer = window.dataLayer || [];
    		function gtag() {
    			dataLayer.push(arguments);
    		}
    		gtag("consent", "default", {
    			ad_storage: "denied",
    			analytics_storage: "granted",
    			wait_for_update: 500
    		});
    		gtag("set", "ads_data_redaction", true);
    	</script>
        <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js"    data-cbid="xxx" type="text/javascript" ></script>    <!-- Google Tag Manager -->
    	<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    	new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    	j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    	'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    	})(window,document,'script','dataLayer','GTM-xxx');</script>
    	<!-- End Google Tag Manager -->
    • This reply was modified 2 years, 10 months ago by pimn.
    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Christian,

    Since GA3 and GA4 uses a different data structure, it is very hard to give both versions and also comply with every use case. I understand that GDRP complience is a must I would like to assure you that my goal is to support those cases as much as possible.

    Using trigger group won’t work in any case, that’s for sure. But this is usually not the only way to setup your tags to fire only on specific consent events.

    Almost all cookie consent solutions store their consent status in a (1st party) cookie too. And Google Tag Manager can read those cookies. Unfortunately your consent banner is not showin in my browser, there is a JavaScript error generated by your tool:

    Uncaught TypeError: Cannot read property 'link' of undefined
        at cmpsource.setDataLayerTealium (cmp_en.min.js:1)
        at cmpsource.refreshDataLayer (cmp_en.min.js:1)
        at cmpsource.setConsent (cmp_en.min.js:1)
        at cmpsource.setConsentViaBtn (cmp_en.min.js:1)
        at HTMLAnchorElement.onclick ((index):1)

    In general, what we usually do at my agency is that we read the consent data from the proper cookie directly and use this in our triggers or we are creating exception triggers so that specific tags do not fire if a consent is not given (yet). This way, you can avoid using trigger groups and fire your tags just at the right time.

    Thread Starter burgis111

    (@burgis111)

    Hi Thomas,

    thank your very much for your quick answer and your help.

    I tried the solution with the CMP cookies. But consentmanager.de uses a custom version of encoded TFC Consent Strings stored in the cookies and I wasn’t able to make use of it.

    Instead I changed your plugin code for EEC and commented out the parts that are used for GA4. This prohibits me from updating the plugin but the shop won’t receive any woocommerce updates either because the owner wants to move to another shop system in the near future. So it’s a temporary solution but it seems to work fine for us.

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    They have a JavaScript API that allows you to query the consent status just when the orderCompletedEEC event fires:

    https://help.consentmanager.net/books/cmp/page/javascript-api

    As far as I can see

    __cmp('getCMPData')

    … for example returns an object where there is a purposeConsents key allowing you to check which consent category has been accepted. With that, you do not need to use trigger groups.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Conflict with GA4 “purchase” event’ is closed to new replies.