HeyMark
Content

Blog

Meta Pixel and Conversions API: what each one measures

6 min read

The Meta Pixel is JavaScript code your website runs in the browser to tell Meta what each visitor does, such as viewing a product or buying. The Conversions API sends those same events, or others, from your server, ecommerce platform or CRM, without going through the browser. Meta recommends using both at once, which it calls a redundant setup, and deduplicating events that arrive twice.

What each channel covers

Channel What it sends When an event gets lost
Pixel Browser events such as PageView, AddToCart or Purchase, with the context of the visit When the browser doesn’t load or run the code: if it doesn’t run, the event isn’t sent
Conversions API Website, app and business messaging events, plus offline conversions, sent from your server, platform or CRM When your system doesn’t send it, or sends it without data that lets Meta recognize the person

The practical difference is who sends the event. With the Pixel, it depends on each visitor’s browser. With the API, it depends on your system, which can also report sales that never went through the website, such as an order closed on WhatsApp and recorded in the CRM.

Using both carries a risk: counting twice

If the Pixel and the server report the same purchase with nothing linking them, Meta can record two purchases. Conversions and ROAS get inflated, and the campaign looks better than it is.

Meta solves this with deduplication. The Pixel event and the server event must share a name (event in the Pixel, event_name in the API) and an ID (eventID in the Pixel, event_id in the API). If both reach the same Pixel within 48 hours, Meta discards the one that arrives later; when their content is the same, it generally keeps the one received first. If you send an event through only one channel, there’s nothing to deduplicate.

Example: one purchase sent through both channels

Fictional case. A store receives order 1048 for 59,990 Chilean pesos. It uses the order number as the ID, because both the confirmation page and the server know it.

In the browser, the confirmation page runs:

fbq('track', 'Purchase', {value: 59990, currency: 'CLP'}, {eventID: 'order-1048'});

The server sends the same event to the Conversions API (shortened version):

{
  "data": [{
    "event_name": "Purchase",
    "event_id": "order-1048",
    "event_time": 1794240000,
    "action_source": "website",
    "event_source_url": "https://example.com/order/confirmed",
    "user_data": {
      "em": ["e233d4a29013e9d87150c6237c6777bedf379ebf1acdc5d6126fec7e8bb74fb5"],
      "client_ip_address": "203.0.113.10",
      "client_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)",
      "fbp": "fb.1.1794239000000.1234567890"
    },
    "custom_data": {"value": 59990, "currency": "CLP"}
  }]
}

Three details decide whether it works:

  • The same name and the same ID on both sides. If the browser uses order-1048 and the server uses 1048, Meta treats them as two purchases.
  • The email is normalized and hashed before sending: no leading or trailing spaces, and lowercase. In the example, customer@example.com travels as its SHA-256 hash, the value of em. Meta requires hashing for contact data such as email or phone, and asks you not to hash the IP address, the user agent, or the fbp and fbc cookies. The user agent is required for website events sent through the API.
  • event_time is when the purchase happened, in seconds since 1970 (Unix time), not when you sent it.

Sending the email as a hash avoids sending it in plain text, but it doesn’t make it anonymous: Meta uses it to match the person to an account. It also doesn’t replace the consent your country’s law may require before sharing it for advertising.

Which setup to choose

How you sell What to do What to check
Store on a platform with an official Meta integration Turn on the integration and check that it sends both Pixel and API events That both events arrive with the same ID
Your own website with a server Send key events from the server, in addition to the Pixel Correct hashing, IP and user agent, and the same event_id as the Pixel
Sales closed outside the website (WhatsApp, phone, physical store) Send those sales from your CRM through the Conversions API That they identify the customer with data Meta can match, and that the event source is the right one

You don’t need to send everything through both channels. Start with the events your campaigns optimize for, usually purchase or sign-up, and expand from there.

How to check it

In Events Manager, the test events tool shows whether each event arrives from the browser, from the server or from both. Place a test order with a new order number and check that it arrives through both channels with the same name and the same ID: that match is what lets Meta discard the duplicate.

Complete measurement doesn’t decide which ad gets credit for the sale. That’s a separate question, which we cover in marketing attribution models. For traffic from links in your organic posts, UTM parameters are still the tool.

Plan your next post in HeyMark.

Keep the idea, review the draft with your team, and see how it performed in the accounts you connected.