Can/Should we stop firebase inserting the gtag script and instead defer to Google Tag Manager? #4927
Replies: 2 comments 3 replies
-
I'm not clear how GTM and gtag interact with each other. @hsubox76, would you know? Just to understand your use case - It seems you have linked your Firebase web app to GA, and obviously you want to log analytics events to this measurementId. Do you use any Firebase growth products like Remote config or Cloud messaging? If you do, you have to use |
Beta Was this translation helpful? Give feedback.
-
In that line, it's added in a gtag config call. Properties added to a measurement ID in gtag config should be sent with every subsequent event to the same measurement ID. As far as duplicate events: when a user puts gtag on their page, the initial page view is only triggered by the I'm not clear what the equivalent is in GTM but looking around it seems like this is handled in the backend console by creating a tag with a "Page View" track type and setting it to trigger on "All Pages". If you disable that, then it shouldn't send duplicate initial page view events with Firebase Analytics. Let me know if I'm incorrect. Also let me know if I'm correct, and I'll also add this to the documentation (we don't have a section for GTM users right now). Edit: Also if you want to continue to use GTM page views and disable page_view logging from Firebase Analytics instead, we're working on making that functionality available in the new modular API (v9), by letting you provide an initial config option where you can set the Google Analytics param |
Beta Was this translation helpful? Give feedback.
-
Hello!
I've found that Firebase SDK will insert a gtag script into the page to enable logging events using
firebase.analytics()
. It will even do this if you don't include a measurement ID because it actually queries your apps config dynamically (which includes a measurement ID).This is a pain when it comes to trying to use Google Tag Manager. Ideally I want everything to be done via Tag Manager and I'm worried that having both on the page will double up on events being counted (especially because a number of events are collected by default).
I can see this going one of three ways:
firebase.analytics()
but instead with GTM.Option number 3 seems to be the simplest to reason about however I'm not sure if the Firebase SDK actually provides a way to turn off analytics.
Would love any tips or tricks to deal with this!
Beta Was this translation helpful? Give feedback.
All reactions