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

279
Views
GTM - Do not fire an HTML tag if the customer refreshes the page

We have currently an order confirmation page on our website after the customer paid where information is sent to our analytics tools. If the customer refreshes the page, the information about his order is sent again to our analytics tool and then we get wrong/duplicate information in our orders statistics.

Is there an easy way to prevent this? The goal would be here to not trigger the custom html tag when the customer reloads the page. It should be only fired once.

Thanks!

Best, Victor

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can use PerformanceNavigation.type or PerformanceNavigationTiming.type respectively in a Javascript variable to find out if the page has been reloaded (the former is already marked as deprecated while the latter is still marked as experimental, so to be on the safe side you should probably check which one is supported by the browser and use that).

Then use the return value to detect reloads and block the tag depending on that.

An alternative would be to set a cookie or local storage entry with the transaction and block based on that.

about 4 years ago · Juan Pablo Isaza Report

0

We finally found another solution that seems to work: We used an additional trigger in GTM that prevent the info to be sent twice.

GTM Trigger

When calling the page for the first time, the condition is set to "false", and on each following request to that page it is set to "true".

We made some test orders and it seems to works correctly. Thanks!

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!