Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

204
Views
Can I use Firebase Analytics and gtag at the same time?

I have a firebase application. I am using firebase analytics. Like that;

import { getAnalytics } from "firebase/analytics";

const analytics = getAnalytics();

But now client asked to add google analytics also inside head tag. Do I need to remove firebase analytics or both of them will work fine ?

<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'GA_MEASUREMENT_ID');
</script>

Maybe you have better solution

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

When you activate Firebase Analytics and manually add gtag script both of them appear in source code. Like that;

Firebase --- >
<script type="text/javascript" async="" src="http://www.googletagmanager.com/gtag/js?id=MEASUREMENT_ID&amp;l=dataLayer&amp;cx=c">

Script ---->
</script><script async="" src="https://www.googletagmanager.com/gtag/js?id=MEASUREMENT_ID"></script>
<script>
      window.dataLayer = window.dataLayer || [];
      function gtag() {
        dataLayer.push(arguments);
      }
      gtag("js", new Date());

      gtag("config", "MEASUREMENT_ID");
</script>

And That's why I disabled Firebase Analytics and only keep gtag script.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!