Support » Plugin: MC4WP: Mailchimp for WordPress » ga4 integration

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor Lap

    (@lapzor)

    The Javascript events work exactly the same no matter what analytics option you use, just swap out the line of code responsible for sending the event to google.

    I believe GA4 should work with the “Tag Manager” example on the page you linked.

    Hope that helps. If you have any questions, please let me know!

    Thread Starter raffaelloh

    (@raffaelloh)

    Hi Lap,

    Thanks for the response! I’m not a developer, so..

    What exactly do you mean with “just swap out the line of code responsible for sending the event to google”?

    Also, the setup within google tag manager is different with GA4. Any hints on how this should be done for the gtm setup?

    Thanks again for your help!

    Raffaello

    Plugin Contributor Lap

    (@lapzor)

    Did you already try the Google Tag Manager example as I recommended, and it didn’t work?

    <script type="text/javascript">
    mc4wp.forms.on('subscribed', function(form) {
    	// GTM Data Layer push
    	window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event' : 'Sign-up', 'name' : form.name + ' ID: ' + form.id });
    });
    </script>
    Thread Starter raffaelloh

    (@raffaelloh)

    Hello Lap,

    Yes I did put the script in the form and it is running, but I’m stuck with the configuration within GTM itself. I’m not sure how I should set up the trigger (type + what events) and ga4 event tag (parameters?)

    Do you have a recommendation 🙂 ?

    Plugin Contributor Lap

    (@lapzor)

    I’ve tested your script and it’s working.
    The events should show up in your Google Analytics dashboard, no need to create anything form there.

    https://i.imgur.com/gFMLppu.png

    Thread Starter raffaelloh

    (@raffaelloh)

    Hello Lap,

    Thanks for checking that out! So that basically tells me it was working fine during the past weeks 🙂

    But what’s very strange is, I can test the event and it will appear in GA4 so it looks like everything is working. But only when I test it myself. Because I don’t see any other subscription events coming through (in the past weeks), even though I can see dozens of people subscribing in my mailchimp list. Have you encountered this before?

    Thanks again for your time and support!

    Plugin Contributor Lap

    (@lapzor)

    Many people (like me) have ad-blockers that block the trackers of Google Analytics. Maybe that’s what’s happening?

    Thread Starter raffaelloh

    (@raffaelloh)

    Hey Lap,

    This was my first idea also (I also block trackers). But it’s literally dozens of people in the past couple of weeks, and not a single one is being registered, while all my other events and conversions have hits. If only a small % of my subscribers were showing in GA4 it could be the adblockers, but 0% (only for the mc4wp events) seems like a technical issue to me. Or am I missing something 🙂 ?
    Very glad you’re sharing your expertise with me on this!

    Plugin Contributor Lap

    (@lapzor)

    are there other ways to subscribe, besides this form where you added the tracking?

    I mean, if it works for our tests, it works for that form…

    Thread Starter raffaelloh

    (@raffaelloh)

    Hello Lap,

    This form is the only way people are subscribing to my newsletter.. I’ve been scratching my head for a while on this issue.

    Any other ideas are welcome. Maybe it’s something within GA4 (or GTM) I was thinking? That’s why I started this ticket in the first place 🙂

    Plugin Contributor Lap

    (@lapzor)

    Since it’s working for me it’s very difficult to debug this further.

    I do notice some error on your site that is related to Google Analytics, but (at the very least in my case) that doesn’t seem to stop the event tracking on the form / is not directly related to this issue.

    https://i.imgur.com/FIpqm5O.png

    Thread Starter raffaelloh

    (@raffaelloh)

    Hello Lap,

    I understand. The error you are talking about is most probably the missing ID – this is a common issue with GA4, but a false positive that doesn’t affect tracking.

    Anyhow thanks a lot for your time and expertise, I really appreciate it!

    Raffaello

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.