Add your Meta, Google and TikTok tracking codes
Tracking setup is where you paste the tracking codes from Meta, Google and TikTok so each one can see which ads lead to sales. Paste a code into its card, click Save, check the status light, and send a test event. This guide also shows where to find each code.
Last updated .
Where to find it: /admin/ads/tracking in your admin.
Shows up when the Ads feature is turned on for your site.
How Tracking setup works
Go to Marketing → Ads → Tracking setup. The page has one card each for Meta (Facebook and Instagram), Google (Analytics and Ads) and TikTok. Each card works the same way:
- Paste the tracking code that platform gave you into the box.
- Click Save.
- Look at the status light on the card.
- Click Send test event to check the connection without waiting for a real sale.
You don't need an ad account connected to save a tracking code. The ad account link is only needed for spend reports. Set up only the platforms you advertise on.
Read the status light
| Light | What it means |
|---|---|
| Not set up | No code is saved on this card yet. |
| Waiting for first visit | The code is saved. This is normal until someone visits your site and accepts the cookie banner. |
| Working — last event … | Events are reaching the platform. The light says how long ago the last one was. |
| Couldn't check right now | The status couldn't be read. Click Check again in a moment. |
If a card says the last event was not accepted, click Send test event to see why.
Add your Meta tracking code
The Meta tracking code is your Pixel ID. A Pixel is a small tracking code on your website that tells Meta when someone visits, signs up or buys.
- Go to business.facebook.com/events_manager and log in with the account that owns your ads.
- In the left menu click "Data sources", then click your Pixel. Meta may call it a dataset. If you have none, click "Connect data", choose "Web" and follow Meta's prompts.
- Click the "Settings" tab.
- Copy the number called "Pixel ID" or "Dataset ID". It is numbers only, about 15 or 16 digits.
- Paste it into Meta tracking code and click Save.
The Meta access token is optional but recommended. It lets your site's server tell Meta about purchases directly, which catches sales that ad blockers and iPhone privacy settings would hide. To get one, open your Pixel's "Settings" tab in Meta Events Manager, scroll to "Conversions API" and click "Generate access token". Copy it straight away, because Meta may only show it once.
Meta test code is only needed if Meta asked you for one. It is on the "Test events" tab of your Pixel and starts with TEST. Leave it blank otherwise.
Add your Google codes
The Google card has two groups: Google Analytics 4 and Google Ads (optional).
| Box | What to paste | Where it is |
|---|---|---|
| Analytics tracking code | Your GA4 Measurement ID. It starts with G-. | analytics.google.com → "Admin" → "Data streams" → your website's stream → "Measurement ID". |
| Analytics server secret | Optional. Lets your site's server also send purchases to Google Analytics. | In the same data stream, under "Measurement Protocol API secrets". Click "Create" and copy the "Secret value". |
| Google Ads account code | Your conversion ID. It starts with AW-. | ads.google.com → "Goals" → "Conversions" → your Purchase conversion → "Tag setup" → "Install the tag yourself". It is the part before the slash in the send_to line. |
| Purchase code | The conversion label for a paid purchase. | The part after the slash in the same send_to line. |
| Booking request code | The conversion label for a booking request, when someone asks to book before any payment. | Make a second conversion action in the "Submit lead form" category and copy the part after the slash. |
Send test event on this card goes to Google Analytics 4. Look for it under Reports, then Realtime. It can take a minute. Google Ads purchases and booking requests are counted in your visitor's browser, so they can't be tested from this page.
Add your TikTok tracking code
- Go to ads.tiktok.com and log in to TikTok Ads Manager.
- Click "Tools" at the top, then "Events".
- Under "Web events", click "Manage" next to your Pixel. If you have none, click "Set up web events" and choose "TikTok Pixel".
- Copy the Pixel ID. It is about 20 letters and numbers.
- Paste it into TikTok tracking code and click Save.
The TikTok access token is optional but recommended. It lets your site's server tell TikTok about purchases directly. In TikTok Events Manager, open your Pixel's "Settings", find "Events API" and click "Generate Access Token".
Replace or remove a saved token
Access tokens and the Analytics server secret are stored encrypted and are never shown again after you save them. The box shows Saved instead.
- Click Replace to paste a new one. Click Keep the saved one if you change your mind.
- Click Remove to delete it. It is removed when you click Save. Click Undo before saving to keep it.
If you change a box and don't save, Send test event warns that you have changes that aren't saved yet. Save first so the test uses them.
Prove it works before you spend
A green light and a test event show the connection works. To prove a real sale reaches your ad accounts, make a test purchase on your own site. The checklist on Marketing → Ads → Overview walks you through it under Make a test purchase. See Set up ads and tracking.
Common questions
Where do I find my Meta Pixel ID?
In Meta Events Manager (business.facebook.com/events_manager), click "Data sources", open your Pixel, and click the "Settings" tab. The Pixel ID is a number about 15 or 16 digits long. Meta may call it a Dataset ID.
Where do I find my Google Analytics Measurement ID?
In analytics.google.com, click "Admin", then "Data streams", then your website's stream. The Measurement ID is at the top right and starts with G-.
Why does my tracking light say Waiting for first visit?
The code is saved and nothing is wrong. The light turns to Working once someone visits your site and accepts the cookie banner.
Do I need an access token as well as a Pixel ID?
No, it is optional. It is recommended because it lets your site report purchases from its server too, which catches sales that ad blockers hide from the Pixel.
Why are my page views doubled in Google Analytics?
The "Page changes based on browser history events" setting is still on in your data stream's Enhanced measurement. Switch it off. Your site already reports its own page views.
Can I see my access token again after saving?
No. For your safety it is never shown again. Use Replace to paste a new one.