Skip to content

Conversation

@fdeters
Copy link
Contributor

@fdeters fdeters commented Aug 22, 2024

This PR fixes a bug where the gtag service's event() method sends the event to the window.dataLayer with incorrect syntax. This bug prevents GA4 from receiving any event sent via gtag.event().

I noticed this bug first on my own, then saw it corroborated by @romgere in #8. This comment in that thread matches my experience, and my proposed solution.

Here's the syntax that should be used to send events, via the API documentation:

gtag('event', '<event_name>', {<event_params>});

If accepted, this 1-line change will close #8 and make it possible to send events via this package. Best of all, the change doesn't break existing calls to gtag.event(), it just makes those calls actually work.

Thanks for making this available! I hope this contribution helps.

@hilljh82
Copy link
Contributor

Thank you for this fix!

@hilljh82 hilljh82 merged commit 3eead75 into onehilltech:master Aug 23, 2024
@fdeters
Copy link
Contributor Author

fdeters commented Aug 23, 2024

@hilljh82 thanks for merging this and #10! For some reason, I'm not seeing the new commits showing up on master. Do you know what's up with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Huge event decrease on google analytic after update to ember-cli-google-analytics@1.5.0

2 participants