Measure

Meta Conversions API

Send conversions from Sporetag to Meta with the Conversions API. Paste a pixel id and access token, mark goals, test with a test event code.

The Meta Conversions API lets you send conversions to Meta from a server instead of only from the pixel in the browser. Blockers and short cookie lifetimes make the browser pixel miss sales. Server events fill the gap, and Meta can match them back to the ad.

Sporetag does the server part for you. You paste two values, mark which goals to send, and Sporetag sends them. It is on paid plans: Solo, Studio, Agency and Custom. Free does not include it.

What you need

  • A Meta pixel for your site. Meta also calls it a dataset.
  • Its pixel id, a number.
  • An access token for the Conversions API.

Get the access token

  1. Open Meta Events Manager.
  2. Pick your pixel (dataset) in the list on the left.
  3. Open the Settings tab.
  4. Scroll to Conversions API and find Set up manually.
  5. Press Generate access token. Copy it right away. Meta shows it once.

The pixel id is at the top of the same Settings tab.

Connect a site

  1. Open the site in Sporetag, then the Integrations tab.
  2. Under Meta Conversions API, paste the pixel id and the access token.
  3. Press Save.

The token is encrypted before it is stored. Nobody can read it back in the dashboard, not even you. To replace it, paste a new one. Disconnect deletes it.

If the setup card says Meta sending is not switched on yet, the server is missing its encryption key. That is ours to fix, not yours.

Choose what to send

In the same card, under Goals to send, tick each goal you want and pick its Meta event:

Meta eventUse it for
PurchaseA paid order
LeadA form or a quote request
CompleteRegistrationA signup
AddToCartAn item added to the cart
InitiateCheckoutThe start of checkout
SubscribeA paid subscription or a newsletter
ContactA call, chat or email
CustomAny other name, letters and digits

Press Save goals. From then on, every match of the goal goes to Meta, from the browser and from the Events API.

What each event carries

  • event_name, event_time and event_id.
  • action_source set to website, and event_source_url: the page, without its query string.
  • client_ip_address and client_user_agent of the visitor.
  • fbc, from the fbclid on the landing page or Meta's _fbc cookie, and fbp from Meta's _fbp cookie, when present.
  • em and ph: email and phone, normalized and SHA-256 hashed, when you sent them with the Events API.
  • external_id: the SHA-256 hash of the visitor's first-party id, or of the visitor.id you sent.
  • value, currency and order_id, when the event has them.

The raw email and phone never leave your server unhashed, and Sporetag never stores them.

Count once with the pixel

If your pages also run the Meta pixel, Meta would count the same sale twice. It counts once when both sides send the same event name and the same event id. Make the id in the page and give it to both:

JavaScript
const id = crypto.randomUUID();
fbq('track', 'Purchase', { value: 49, currency: 'USD' }, { eventID: id });
sporetag('Purchase', { event_id: id, value: 49, currency: 'USD' });

From your server, send the same id as event_id in the Events API. An order id works well, such as order-1042, if the page uses it too.

A goal on a page visit (such as /thanks) gets an id Sporetag makes up, which the pixel cannot know. Send that conversion from one side only.

Test it

  1. In Events Manager, open your pixel, then the Test events tab.
  2. Copy the test event code, such as TEST12345.
  3. Paste it into Test event code in Sporetag and save.
  4. Trigger the goal on your site. It shows in Meta's Test events tab within a minute.

While a test code is saved, Meta treats every event as a test. Remove the code when you are done.

The delivery log

Delivery log lists the last 100 sends, newest first, with Meta's answer for each one. Failed shows only those that did not get through.

  • Sends that fail for a passing reason (Meta busy, a network error) retry after 1, 2, 4, 8 minutes and so on, up to 6 hours apart, for 24 hours. Then they show as Gave up.
  • Sends Meta refuses for good (a bad field) show as Failed.
  • If Meta refuses the token, sends wait as Waiting until you save a new token. They then go out, if they are under 24 hours old.

The log never shows the token, the IP address or any email or phone.

Sending the visitor's IP address, browser and click ids to Meta shares personal data with Meta. In the EU and UK this usually needs consent, whatever mode the site is in. In Attribution mode with Wait for consent on, browser events go to Meta only after sporetag('consent', true). See Tracking modes.

Match quality

Meta matches better with more to go on. In Private mode, click ids live only for the visit, so a sale on a later day has no fbclid. Use Attribution mode to keep click ids for 90 days, and send email or phone from your server with the Events API.

Sending offline conversions to Google Ads is planned for after v1 (when shipped).

Something missing or wrong? Email hello@sporetag.com.