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

126
Visualizações
Tracking traffic sent to clients

I have a new directory website with Google Analytics 4.

I am trying to record website_click events when someone clicks a link that takes them to the external website. This is to understand and report on how much traffic I am sending to these clients.

Unfortunately, I can't see the event being recorded. I have tried installing and using Google Analytics Debugger but I see no new output in my Console.

Here is the code I am using

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

  gtag('config', 'G-HIDDENTAG');
</script>
 <script>
    $( document ).ready(function(event) {
      $( ".link_to_provider" ).click(function(event) {
        event.preventDefault();
        setTimeout(visitProvider, 1000);
        var visited = false;

        function visitProvider() {
          if (!visited) {
            visited = true;
            window.open('https://www.example.com');
          }
        }

        // Sends the event to Google Analytics and
        // resubmits the form once the hit is done.
        ga('send', {
          hitType: 'event',
          eventCategory: 'provider',
          eventAction: 'website_visit',
          eventLabel: 'CID-10',
          hitCallback: visitProvider
        });
      });
    });
  </script>
  </head>
  <body>
  ....
                          <a href="https://www.example.com" rel="nofollow" class="link_to_provider"><button class="btn btn-primary px-4 mb-1 mt-0">Visit Website</button></a>
.....
  </body>

Thanks for the help.

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