Search code examples
javascriptgoogle-analyticsgoogle-tag-managergtag.js

gtag sending two events for a single call


Referencing https://developers.google.com/gtagjs/reference/api I am calling gtag('event', 'sign_up') when a sign up happens. This results in a single network call being made which for some reason clearly contains two events in the payload. One event has an "engagment time" of 1 millisecond whereas the other has an engagement time value of many seconds -- it looks like it is roughly the period of time since when the previous event was triggered?

This results in two sign_up events being recorded by Google Analytics. I am only using Google Analytics and gtag, not GTM or anything else.

How can I make the gtag call send just one event?


Solution

  • Turns out it was because I had made a custom event in GA for the sign_up event which I thought was necessary. Just needed to delete that custom event and everything worked as expected.