Set up the Facebook Pixel and server-side tracking
Updated 29 November 2026
When Facebook knows who visits your shop and who orders, your ads reach the right people and you can see which ad sold. This guide turns on two things: the Facebook Pixel and server-side tracking (the Conversions API). It takes 15–20 minutes. You add no code; Shop Lab puts it on your shop for you.
Two kinds of tracking: what each does
The Facebook Pixel tells Facebook, from the customer's browser, what they did in your shop. It is on every plan.
Server-side tracking (the Conversions API) sends your orders to Facebook straight from Shop Lab's server. When a customer's phone blocks ads or an iPhone limits tracking, the Pixel often cannot report; the server still gets through. It is on the Pro plan (and during the trial).
- The Pixel reports: page views (PageView), product views (ViewContent), WhatsApp button clicks (Contact), add to cart (AddToCart), checkout started (InitiateCheckout) and order placed (OrderPlaced).
- The server reports: OrderPlaced when an order is placed, and Purchase with the order amount when you mark the order "Delivered". With cash on delivery the real sale happens on delivery, so Facebook counts sales from delivered orders.
- When the same OrderPlaced comes from both the browser and the server, Facebook counts it once, because both carry the same event ID.
What you need first
- A Facebook Business portfolio (formerly Business Manager) at business.facebook.com. If you have none, create one there for free with "Create an account". A Conversions API token can only be made from a Pixel inside a Business portfolio.
- Full (admin) access to that Business portfolio. Only people with that access see the link that makes the token.
- A Shop Lab panel login (app.shoplabhq.com) as the shop owner or staff.
- For server-side tracking: the Pro plan or a running trial. On Starter only the Pixel works.
Step 1: Create a Pixel (dataset)
If you already have a Pixel, do not make a new one: use it and go to step 2.
- On a computer, open business.facebook.com and choose your Business portfolio.
- Open "Events Manager" from the left menu (or "All tools").
- Press the green "Connect data" button.
- Choose "Web" and press "Connect".
- Name the dataset, for example after your shop, then press "Create". If it asks for a website, enter your shop's address.
- If it asks you to install code or pick a partner, install nothing. Close the window; Shop Lab adds the code itself.
Step 2: Copy the Pixel ID
- In Events Manager, choose your dataset in the list on the left.
- Open the "Settings" tab at the top.
- Copy the 15–16 digit number shown as the dataset ID or Pixel ID.
Step 3: Add the Pixel ID in Shop Lab
- Sign in at app.shoplabhq.com and open your shop.
- Open "Settings" from the left menu.
- In the "Facebook Pixel" part, paste the number into "Facebook Pixel ID". Pasting the whole Pixel code from Facebook also works; Shop Lab takes the number from it.
- Press "Save" right below it.
Step 4: Check that the Pixel works
- In Events Manager, open your dataset and go to the "Test events" tab.
- Enter your shop's address and press "Open website".
- In the tab that opens, visit a few shop pages and one product.
- Back in Test events, PageView and ViewContent appear within seconds.
Step 5: Make a Conversions API tokenPro plan
- In Events Manager, open your dataset and go to the "Settings" tab.
- Scroll down to "Conversions API".
- Under "Set up manually", press "Generate access token".
- Copy the whole long token. Facebook will not show it again; if you lose it, make a new one.
Step 6: Save the token in Shop LabPro plan
- In the Shop Lab panel, open "Settings" and press the "Facebook Conversions API" tab at the top.
- Paste the token into "Access token".
- Press "Save token". "Saved" appears beside it.
The token is stored encrypted and never shown in the panel again, not even to your staff. To change it, use "Replace token" and paste the new one. A new token made in Facebook may stop the old one working, so put the new one in Shop Lab too.
Step 7: Send a test eventPro plan
- In Events Manager, on your dataset's "Test events" tab, find the test code for server events (for example TEST12345) and copy it.
- In Shop Lab, in "Facebook Conversions API", paste it into "Test code" under "Test event".
- Press "Send test event". "Facebook's answer" appears below; on success it says events_received.
- In Events Manager's Test events, a PageView from the server appears within seconds. That's it: setup is done.
What happens with real orders
- When a customer orders, the server sends OrderPlaced with the order total.
- When you mark the order "Delivered" in the panel, it sends Purchase. So remember to update an order when it is delivered.
- Real orders carry no test code, so they show in Events Manager's "Overview", not in Test events. This can take up to 20 minutes.
- "Last send result" in Settings shows whether Facebook accepted the latest event.
- Facebook refuses events older than 7 days. If an event could not be sent for 7 days, it is dropped and the result says so.
Privacy: the customer's phone number and city are hashed (turned into a one-way code) before they go to Facebook; the name and full address are not sent. Also sent: the products, quantities and amount, and the customer's browser details (IP address, browser type and Facebook's cookies). Shop Lab's privacy policy has the details.
Turning it off or changing it
- Pause server-side tracking: in Settings → "Modules", switch off "Server-side tracking" (shop owners only). New events stop, events already queued are sent, and your token stays saved.
- Delete the token: in "Facebook Conversions API", tick the confirmation box and press "Delete token".
- Turn off the Pixel: empty "Facebook Pixel ID" and save.
- Moving from Pro to Starter stops server-side tracking but keeps the token; back on Pro it works as before. The Pixel keeps working on every plan.
Problems and fixes
- "Pixel ID must be numbers only…": copy the number from Events Manager again; digits only, no spaces.
- "That token does not look right": not all of it was copied, or a space got in. Copy and paste it again.
- "Save a token first to send a test event": finish step 6 first.
- A yellow note in "Facebook Conversions API" means no events are going out from the server. "Server-side tracking is included in Pro": your shop is on Starter; you can keep the token, but no events go until you move to Pro; message Shop Lab support on WhatsApp to upgrade. "Server-side tracking is switched off": the module switch is off; turn it on in Settings → "Modules". "Shop Lab has turned server-side tracking off": contact Shop Lab support.
- Facebook's answer mentions the token or permissions (for example "Invalid OAuth access token"): the token belongs to another dataset or was revoked. Make a new one in this dataset's Settings and save it again.
- Nothing from the Pixel in Test events: wait a minute after saving, turn off your ad blocker, and check that the Pixel ID in the panel matches the dataset ID in Events Manager.