Search code examples
firebasegoogle-analyticstagsgoogle-tag-managerfirebase-analytics

how to forward firebase analytics data to other trackers


Firebase seems to create a google tag for each web app that i create inside a firebase project. This tag works perfectly fine and sends all my custom events via logEvent() to google analytics.

Now i would like to add other trackers, such as linkedin insight or meta pixel.

How do i do that? Obviously I can just add the tracking code to my html and then call specifig log functions for each tracker, but the purpose of google tag is to avoid exactly this, no? But at the same time it seems i cannot "connect" these destinations to my existing tag. I can only add new tags, which I then also need to add to my app.

What's the best option to solve this?


Solution

  • Seems like you're mixing up GTM, gtag and firebase sdk.

    You didn't indicate whether your app is native, but firebase is mostly used in native apps. And in apps that end up native after building, like react native.

    Gtag and GTM are used in the world where you can execute arbitrary JS without the need to rebuild the app. Which might be your case since you've indicated html. In that case, you need to install GTM, not gtag, then reimplement your tracking in GTM, remove gtag and then you can add tags to GTM, including any third party pixels to your GTM and they will fire without the need for you to rebuild the webapps.

    Now, true. There is GTM for native apps, but its functionality is extremely slim. It has no way to run custom code, it has very few variables available and the only way for it to send pixels is just through a pre-hardcoded endpoint. It's generally considered not worth it.

    Most popular pixels have their own SDKs for conversion tracking. You can always make your custom functionality to send data to their endpoints, instead of using their SDK if you want.