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

258
Views
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 answers
Answer question

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 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!