Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

136
Visualizações
Fire Tag in Google Tag Manager on url change of React Application

I have added Google Tag Manager to my React Application with the help of this module - react-gtm-module

So i initialized my GTM on base file as the doc says

  const tagManagerArgs = {
    gtmId: process.env.REACT_APP_GTM_KEY,
  };
  TagManager.initialize(tagManagerArgs);

//This code only executes the first time when the site loads, not on every route change

and i see the script tag in my tag

<script src="https://www.googletagmanager.com/gtm.js?id=GTM-XXXXXXX&gtm_auth=&gtm_preview=&gtm_cookies_win=x"></script>

So as soons as i open my website i see container load in the debug mode of GTM and see the tag GA - UA-XXXXXXX - All Pages fired properly.

Now i have a button in my home page which on clicking takes me to the new route, so in debug mode i see history change but I want to fire GA - UA-XXXXXXX - All Pages Tag in that history change, which doesn't happen. This tag only gets fired when i refresh the website on any of the routes

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda