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

259
Visualizações
Best practices to use the same data layer variable with Google Tag manager without Google Tag Manager Server

I am trying to implement conversions API on our page and of course the main issue is the deduplication of events. The way I avoid this, is using same event names and same event IDs (random unique variable generated at specific time). As I understand it, Google Tag Manager (GTM) will fire tags when certain conditions are met (for example page load), and send the events to the pixel. I am trying to send the same event from our page's javascript. For the simplicity's sake, I started with the 'pageView' event.

I am trying to achieve all of this with only Tag Manager and our code (not using Google's Tag Manager Server-side option)

I've implemented some methods to try get the dataLayer variable (I defined a new one, called EventID), but I see that the value is stored in the dataLayer when the page loads - however, when checking my events, it shows that event id is undefined (the value of the dataLayer's EventID variable was not yet set at the time when my function was called. So events are sent with 'undefined' eventID's, but when I open dev console and check the dataLayer variable the expected random eventID number is there.

I've also added a new tag called "datalayer Event ID" which is supposed to fire when page loads and store the newly generated event id to dataLayer where it can get fetched. The code is simple and it looks like this:

<script>
  ID = [our FB Pixel ID] + Date.now();
  dataLayer.push({'eventID' : ID});
</script>

Could someone with more experience please comment on this:

  • Is this way of doing it correct? Am I missing some triggers/should define different time/place when this tag should fire?
  • Is there a different approach I should take to implement the deduplication?

Thanks for any info!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Just pushing eventID to dataLayer will change nothing in your case. You need to change the configuration of the FB tag itself.

Not sure why you don't want to use sGTM because looks like this is the easiest option for you.

Here is a good blog post on how to set up Facebook event deduplication in Google Tag Manager

about 4 years ago · Juan Pablo Isaza Relatório
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