We run a small Israeli tools and home-improvement store, ramo.co.il, on Next.js and Vercel. A few weeks ago our ad dashboards said we were doing great. Our bank account disagreed.
The cause was dull: the purchase event fired twice on the thank-you page. Once on the first render, and again after a client-side navigation re-mounted the component. Google Ads and Meta both happily counted two sales, and the bidding algorithms started paying more for traffic that wasn't converting as well as they thought.
How we found it
Not from the dashboards. We opened the network tab, finished a test order and watched two identical purchase hits go out a few hundred milliseconds apart. That was the whole investigation.
The fix
- Fire purchase events from one place only, keyed by order ID.
- Store the order ID in
sessionStorageafter sending, and skip if it's already there. - Pass the same
transaction_id/event_idto every platform so they can dedupe on their side too.
The test that keeps it fixed
The real win was a Playwright test that runs before every deploy. It loads a product page, adds to cart, completes a test checkout and counts outgoing requests per platform. If any tag fires zero times or more than once, the deploy is blocked.
It takes about a minute to run and it has already caught one regression from an unrelated refactor.
If you sell anything online, check your purchase event today. Place a test order with the network tab open. It's five minutes, and it might explain why your ROAS looks better than your revenue.



![Henry Cavill builds 16-bit ‘Mustache Protocol’ game on Googlebook for a good cause [Video]](https://9to5google.com/wp-content/uploads/sites/4/2026/11/Henry-Cavill-Mustache-Protocol-Googlebook.jpg?quality=82&strip=all&w=1600)