Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

202
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda