alinemorelli / react-gtm

React Google Tag Manager
MIT License
659 stars 140 forks source link

Bad Event Tracking Code - The Landing Pages report has a (not set) entry. #55

Open Nyx23 opened 4 years ago

Nyx23 commented 4 years ago

We are using this package with https://github.com/react-ga/react-ga Is this generally advised? We are getting a "Bad event tracking code" in Google Analytics

The Landing Pages report has a (not set) entry.

A pageview hit must precede event hits in order for the event hits to include the page that they fire from. When event hits aren't preceded by a pageview, Google Analytics doesn't have the page for the event hits, so their page is (not set).

Verify that tracking code for the property sends a pageview hit before sending any events.

Google Tag Assistant Recordings can help you verify that your hits are sent in the correct order.

How do advise we track GA and GTM using your plugin?

Thank you!

Random-Black-Coder commented 4 years ago

My understanding is that because of how google analytics works and because both gtm and GA are using shared resources (the data layer) conflicts can arise. So it may be better to just use GTM since that also includes vanilla GA tracking.

Side note: We traditionally used reactga, but we are switch to gtm because we want to be able to add the tracking pixels from multiple other sites like FB, LinkedIn etc. without adding all of the code for each one separately.