Learn business growth with Google Analytics 4 Forums Google Analytics 4 Repetitive firing of GTM events: What could be the cause?

  • Repetitive firing of GTM events: What could be the cause?

    Posted by Gabriel on 19 April 2023 at 4:42 am

    I noticed an issue when working with my NextJS app that uses GTM to pass an event to GA4. When I initialize GTM via the react-gtm-module package and create a custom event ‘view_faq’, it seems to trigger more times than intended when I perform a button click that pushes to the data layer. The event fires about ten additional times in succession, and I see it multiple times in Tag Assistant and GA4 debug view.

    Even more peculiar, when looking at each fired event and corresponding API call, only the data layer pass seems to change with a parameter called ‘engagement_time_msec’. The initial API call goes as planned, but the subsequent ten calls only modify the ‘engagement_time_msec’ field. As I’m a bit stumped by this, do you know what might be causing this issue?

    Taylor replied 11 months, 1 week ago 3 Members · 2 Replies
  • 2 Replies
  • Kelsey

    Member
    23 April 2023 at 5:07 am

    Sure thing! So you’ve got an event in your NextJS app, right? You’re using the GTM module and GA4 to track when this event happens – all standard practice. But something’s off: the event fires about 10 times more than it should. And when looking at the event data, all that changes is the ‘engagement_time_msec’ parameter.

    Well, it seems like this might be because of the way you’ve set up your custom event in GA4 and GTM. The event you push onto the data layer is named ‘my_test_event’, and the trigger for a custom event in GTM is also ‘my_test_event’. Then, in GA4, another custom event that triggers based on the ‘my_test_event’ fires.

    That’s like shooting a boomerang and having it return only to throw it again immediately – it creates an echo effect. This can explain why the event fires about 10 times more than expected, and why only ‘engagement_time_msec’ changes with each round.

    Simple fix? Don’t have a GA4 custom event that triggers based on an event with the same name. Pretty much ‘don’t play boomerang with your events!’.

  • Taylor

    Member
    18 June 2023 at 9:35 pm

    It’s highly probable that the issue is occurring due to the unnecessary creation of a custom event in the GA4 configuration. The GA4 interface allows for the creation of ‘new events from existing events’, a feature that might inadvertently result in duplicated event fires when incorrectly configured. You might want to check if you’ve actually configured such a custom event which could be causing multiple triggers. This may explain why the ‘view_faq’ event triggers multiple times for a single button click.

Log in to reply.