Ecommerce event code generator

Pick the event, add the products, and copy code for Google Tag Manager or gtag, the Meta Pixel and the TikTok Pixel. Every block uses the same event id, which is what lets each platform merge the browser copy with the server copy.

  • Free
  • No sign-up
  • Runs in your browser

Items

Item 1

ID is required.

Enter a valid price.

Fix the fields above to get working code.

How it works

1

One event id everywhere

On a purchase the id is your order id, so a reloaded thank-you page and the server event carry the same id and count once. Other events get a fresh random id: send that same id with the server event.

2

Clear the old ecommerce object

The GA4 block pushes { ecommerce: null } first. Without it, Google Tag Manager can merge the previous event's items into this one.

3

Exact totals

Value is price × quantity added up in whole poisha or cents, so prices like 0.10 never turn into 0.30000000000000004.

Which TikTok event is a purchase?

CompletePayment is TikTok's standard event for a completed payment, and the one this generator uses.

Do I need this with Trakero?

No. The Trakero WooCommerce plugin and Shopify app send these events with matching ids for you. The generator is for custom sites and for checking an existing setup.

Let Trakero do this for every order

Trakero captures click ids, hashes customer data and sends each purchase once to Meta, TikTok, GA4 and more from your server, so ad blockers and Safari can't lose it.

Start free

Tracking rules change. We'll tell you.

A short email when Meta, Google or TikTok change a tracking rule that affects stores, and when we add a free tool. A few a year. Unsubscribe in one click.

We use your address only for these emails. Privacy policy.