Meta Pixel, Conversions API and attribution

How do I get an access token for the Meta Conversions API?

The token comes from Events Manager, in the dataset settings under the Conversions API section. Where to find it, who can see it, and how to keep it safe.

Published

You get a Meta Conversions API access token in Events Manager, on the dataset you already use for the Pixel: open its Settings tab, find the Conversions API section, and use Generate access token under Set up manually. The link is visible only to users with developer privileges for the business, which is the usual reason people cannot find it. The token then lives on your server, in an environment variable or a secrets store, and never in the landing page’s JavaScript.

Two routes, same object

Meta recommends generating the token in Events Manager, and offers a second route through business settings for teams that already run an app and a system user. Both produce a token that authorises your server to post events to that dataset.

Events ManagerBusiness settings, system user
Wherethe dataset Settings tab, Conversions API sectionbusiness settings, assign the dataset to the system user, then generate
Best forone site, one team, quick setupseveral datasets, a service that runs unattended
Needs developer privilegesyesyes, on the system user
App Reviewnono

Meta states that neither route needs App Review or extra permissions, and that tokens generated since v12.0 work with every available Graph API version. That removes two worries people bring from the Marketing API, where both of those things are real.

The steps in Events Manager

  1. Open Events Manager and select the dataset that the Pixel base code uses. Check the name and the ID, not just the name.
  2. Open the Settings tab. This is where the dataset categories, the Conversions API section and the token live.
  3. Find the Conversions API section and look under Set up manually.
  4. Click Generate access token and follow the pop-up to the end. Copy the value it shows.
  5. Store it immediately. The pop-up is not a place to come back to later.

If the option is missing rather than disabled, the cause is almost always the role: the account needs developer access to the business portfolio that owns the dataset. An agency working in a client portfolio needs that role granted by the client, or a token generated by someone who has it. What is the Meta Marketing API and how does an agency get access? covers how access works across portfolios.

The Pixel ID you pair with the token is the same number with two names. Newer Meta tools call it a dataset ID, and the Dataset Quality API takes a dataset_id that it describes as the ID of the dataset (Pixel). Meta dataset explains why one object carries both labels.

The system user route

This is the route to take when the token has to outlive the person who created it. The steps are in business settings rather than Events Manager:

  1. Open business settings and find the system users area.
  2. Assign the dataset (the Pixel) to the system user that will send the events.
  3. Select that dataset in the system user’s assets and generate the token there.

The advantage is ownership. A token generated by a named employee is a token tied to an account that can be deactivated, and an agency that hands a client a server integration built on a personal token has built something fragile. A system user belongs to the business, so the integration survives staff changes.

What the token is not

It is not a user access token, and it does not grant access to campaigns, budgets or reports. It authorises event uploads to one dataset. Reading spend and performance is the Marketing API, with its own permissions and its own review process.

It is also not the only field the request needs. A working Conversions API call carries the event name, the event time, the event_id, the action source, the source URL, and the customer information Meta matches on: hashed email and phone, fbc, fbp, IP and user agent. The token is the key to the door, not the payload. How to set up the Meta Conversions API for lead generation has the body field by field.

And it is not a way around deduplication. If the browser also fires the Lead, the two copies are counted once only when the names match and the eventID equals the event_id. Facebook pixel event deduplication covers what happens when they do not.

Keeping the token safe

The token is a secret that lets anyone who holds it write events into your dataset. Three rules cover most of the risk.

Keep it server side. It goes in an environment variable or a secrets manager, read by the process that sends the event. Never in the base code, never in a client-side bundle, never in a repository in clear text. If it has been pasted into a chat or a ticket, rotate it.

One token per client. An agency running ten accounts should hold ten tokens, each tied to one dataset. Sharing one across accounts means a single revocation breaks every client, and it makes an audit of who sent what impossible.

Rotate on change. When a contractor leaves, when a system user is rebuilt, when a secret leaks, generate a new token and deploy it before revoking the old one, so events do not stop in between. A quiet gap in server events is worse than a noisy one, because Meta’s delivery system learns from what arrives.

Testing that it works

Send one Lead with test_event_code in the request body, at the top level next to data, then open the Test events tab for the dataset. Meta returns the event with its parameters, and you can see whether the token was accepted and whether the fields arrived as you intended.

One detail catches people out: events sent with a test code are not discarded. They flow into Events Manager and count for targeting and measurement, so the test lead is a real lead as far as Meta is concerned. Keep the tests few, and remove the code before going live.

After that, the checks that matter are in the Overview tab, where server events should appear within about 20 minutes, and in the Event Match Quality score for the Lead event, where Meta recommends aiming for 6.0 or higher. Server-side tracking for Facebook ads explains what a healthy server event actually buys you, and what it does not.

Questions on this topic

All questions on this topic →

FAQ

Why can I not see the Generate access token link?+

It is shown only to users with developer privileges for the business that owns the dataset. Ask an admin to grant the role, or have them generate the token and store it wherever your server reads its secrets.

Do I need App Review for this token?+

No. Meta says neither route to the token needs App Review or extra permissions. App Review belongs to apps that ask for other people data through the Marketing API, which is a different question.

Does the token expire?+

Treat it as long lived but revocable, not as permanent. Tokens generated since v12.0 work with every available Graph API version, and a token can be invalidated from the business settings. Rotate it if a contractor leaves or a secret leaks.

Can I use one token for several clients?+

Do not. One dataset and one token per client keeps the data separated, and it means revoking one client access does not touch anybody else. The server must send each client leads to the Pixel ID that client browsers use.

Ready to find out what
converts, for real?

Free to start.

Start free →