How to Install the Facebook Pixel and Test Standard Events
Match the pixel ID to the right dataset, install the base code once, and use Test Events to check for missing or duplicate events from product view through purchase.
ok589 Editorial Team4 min read
1. Select the right dataset for your website
- Open Events Manager, switch to the business portfolio that owns the website, and look for its existing dataset under Data Sources. Match the dataset ID to the pixel ID saved in your store admin. Don’t rely on the name alone or create a new dataset just because no events are showing yet.
- If this is your first setup, select Connect Data Sources → Web. Follow the prompts to create or select a dataset, then choose Meta Pixel to send events from the browser. If you can’t see the expected dataset, ask an admin to check the business portfolio and your dataset permissions. For current menu labels, see the Meta Business Help Center.

2. Install the browser pixel base code once
- If your store platform offers an official partner integration, use it to connect to Meta from your store admin. Select the dataset you verified and save. Check which standard events the integration already sends. If it sends
Purchase, don’t add a button-click rule for the same event. - For manual installation, copy the full base code from the dataset’s setup wizard, add it to the head of your sitewide template, and publish. If you deploy it through a tag manager instead, remove the copy from the template. Load the pixel according to each visitor’s consent choice. Check whether the product and checkout pages use the same template.
- Open Test Events, enter a product page URL in the browser event testing section, and launch the site from there. Grant consent through the site’s normal flow, then check that the selected dataset receives a
PageViewfrom the browser. Confirm that one page load sends exactly onePageViewbefore testing other actions.

3. Trigger standard events when the action succeeds
The base code initializes the pixel and sends PageView. For a manual setup, call fbq('track', eventName, parameters) after the corresponding action succeeds. Event names are case-sensitive; use the parameters for each event. Work through one test order and expand each record in Test Events.
| Test action | Expected event | What to check |
|---|---|---|
| Open a product detail page | ViewContent | The product ID matches the catalog. The homepage doesn’t trigger a product view. |
| Add an item to the cart | AddToCart | The product and quantity are correct. A failed add doesn’t send an event. |
| Start checkout | InitiateCheckout | Viewing the cart alone doesn’t trigger checkout. |
| Complete payment for the test order | Purchase | The amount is a number, and the currency matches the order. |
Trigger Purchase when the order is confirmed as paid, not when the customer clicks Pay. For an order with a final payment of US$29, use {value:29,currency:'USD'}. Refresh the confirmation page, then leave and revisit it. Neither action should send another Purchase for that order.

4. Troubleshoot missing or duplicate events
- No events: Confirm you’re testing the published page and the dataset IDs match. Then check the consent state and whether a browser extension is blocking the pixel. Isolate these variables only in your own test environment; don’t bypass visitors’ privacy choices.
- Page views but no purchases: Check the actual checkout domain, the payment return path, and the payment success callback. If a third party hosts checkout, check which events its integration supports. Don’t use a checkout click on your site as a substitute for a successful payment.
- Two records for one action: Check whether each record came from the browser or the server. If both came from the browser, look for duplicate deployments across templates, plugins, and tags. If the browser and server both report the same purchase, verify that they send the same event name and event ID so Meta can deduplicate them.
Launch checklist
- Verify the dataset ID, event sequence, purchase amount, and currency. Save the test order number and event timestamps for troubleshooting.
- Use Test Events to confirm receipt, not ad attribution. To distinguish campaign traffic sources, tag your links with the UTM builder. Don’t count a link click as a sale.