Skip to main content
Blog

Meta CAPI and Google Enhanced Conversions Setup: 11-Step Testing Guide

TL;DRThis guide walks you through a Meta Conversions API (CAPI) setup and a Google enhanced conversions setup, then shows you how to test, troubleshoot and monitor both. You will create the access token, send a first event, deduplicate it with the browser Pixel, check it in Test Events and keep a test log. It covers setup and testing, not policy. For what you may send, use our server-side attribution guide. Last reviewed December 2026.
Key Takeaways
  • Build in this order: access token, first event, event identifier (ID) for deduplication, then Google. Test each step before you move on.
  • Meta requires three fields on every website event sent through CAPI: action_source, event_source_url and client_user_agent. Add event_id too, so Meta can deduplicate.
  • With Meta's recommended method, Meta deduplicates a browser event and a server event when the event name and the event ID match and both arrive within 48 hours.
  • Events sent with a test code still flow into Events Manager. Test with a team member's details, never a patient's.
  • If you upload Google enhanced conversions with the Google Ads API, add an order ID to your conversion tag and upload within 24 hours. The diagnostics report is ready in about 72 hours.
  • Event Match Quality is a diagnostic. Do not add identifiers only to raise the score.

19 min read · Pillar: Digital Health Performance Marketing · Implementation Guide

Moving tracking to the server is easy to say and hard to finish. Teams get stuck on small things: a missing field, an event ID that does not match, a test code left in production. This guide is the hands-on version. It shows you how to set up Meta’s Conversions API (CAPI) and Google’s enhanced conversions, step by step, and how to test each part before you trust the numbers.

CAPI means your server sends a conversion event, such as a contact form request, straight to Meta instead of relying only on the visitor’s browser. Enhanced conversions add first-party customer details, in hashed form, to a Google Ads conversion you already measure. Meta’s Conversions API is an API (Application Programming Interface), which is a way for two systems to talk to each other. Google enhanced conversions can use one too, but you can also set them up with the Google tag or Google Tag Manager. The Meta Pixel is the code on your site that sends events from the visitor’s browser. This is a working guide, not legal advice. Teams that handle patient information must also think about HIPAA (the Health Insurance Portability and Accountability Act).

This guide is about setup and testing. It is not about policy. For what you can and cannot send, start with our guide to server-side HIPAA attribution for digital health. That post and our practical guide to digital health marketing and HIPAA are audit lists. They tell you what to check. This guide is a walkthrough. It tells you what to click, what to send and how to prove it works.

3
fields every website event must carry: action_source, event_source_url and client_user_agent
Source: Meta Conversions API, Best Practices
7 days
oldest event_time Meta accepts. One older event fails the whole request
Source: Meta Conversions API, Using the API
1,000
most events you can send in one CAPI request
Source: Meta Conversions API, Using the API
1 to 10
scale for Event Match Quality, Meta’s matching score for server events
Source: Meta Conversions API, Verifying Setup

What You Are Setting Up

You are setting up two separate things. They use different keys to match an event to an action, so keep them apart in your notes.

Meta Conversions API (CAPI)Google enhanced conversions
Where you set it upEvents Manager, on your Pixel: Settings, then Conversions APIGoogle Ads: Goals, Settings, then Enhanced conversions
What you need firstPixel ID, a Meta Business Suite, and a person with developer privilegesAccepted customer data terms, plus the URL and trigger where your conversion tag fires
How the platform matches the actionSame event name and same event ID from the browser and the serverOrder ID on your tag, when you upload data with the Google Ads API
What you must sendaction_source on every event. event_source_url and client_user_agent on website eventsAt least an email, or a first name, last name, postal code and country. A phone number can go with them
Where you testTest Events tab, with a test codeChrome Developer Tools, then the Diagnostics report
When you can checkWithin 20 minutes in Events ManagerDiagnostics report after about 72 hours

Before You Start

Get these ready first. Each one removes a common reason for a stalled setup.

  • Your Pixel ID and a Meta Business Suite. Meta says you need both to use CAPI.
  • A person with developer privileges for the business. Only those users see the Generate access token link.
  • A written event list. One row per event: its name, the page it fires on and the fields it sends. This is also your checklist for the test log later.
  • Google Ads access to accept the customer data terms. Know the exact URL where your conversion tag fires and what triggers it, such as a form submit.
  • A safe place to test. A staging site, or a test page that no patient uses.
  • A decision on how you will send events. Directly from your server, through a partner tool, or through server-side Google Tag Manager.

Part 1: Set Up Meta CAPI Step by Step

Step 1. Choose how you will send events

Meta lists several ways to connect to CAPI. They vary by effort, cost and features. Meta’s own developer guide focuses on direct builds, and it also has a guide for server-side Google Tag Manager. Pick one method and name an owner. The steps below show a direct build, because the same fields apply to every method.

Meta may place a health-related website or app in a data sharing category with extra limits. Meta’s own names are Core Setup, restriction on certain standard events, and full restrictions. They limit what you can send, such as custom parameters and parts of the page URL, and which events you can use. We cover that in Meta’s new data restrictions. Check which limit applies to your data source in Events Manager before you pick event names.

Step 2. Create the access token

  1. In Events Manager, choose your Pixel.
  2. Open the Settings tab.
  3. Find the Conversions API section.
  4. Under Set up manually, select Generate access token and follow the pop-up.

Only users with developer privileges see that link. If you cannot see it, ask an admin to do this step or to change your role. You pass the token in every API call. Our advice: store it with your server’s secret settings, never in page code.

Step 3. Send your first event

Send a POST request (a way to send data to a web address) to your Pixel’s events address:

https://graph.facebook.com/{API_VERSION}/{PIXEL_ID}/events?access_token={TOKEN}

Here is a minimal website event. Replace the placeholders. It uses a generic event name and a generic page, on purpose.

{
  "data": [
    {
      "event_name": "Lead",
      "event_time": 1796292000,
      "event_id": "lead-20261203-0001",
      "event_source_url": "https://www.example.com/contact/",
      "action_source": "website",
      "user_data": {
        "client_ip_address": "203.0.113.10",
        "client_user_agent": "Mozilla/5.0 (example user agent)"
      }
    }
  ]
}

A real event usually also carries the fbp and fbc browser values. Send event_time as a Unix timestamp in seconds. Replace the sample number with the current time. The time can be up to 7 days old. If any event in the request is older than 7 days, Meta returns an error for the whole request and processes none of the events. You can send up to 1,000 events in one request, but Meta recommends sending each event as it happens.

Step 4. Check the required fields

  • action_source is required on every event. Use website for a conversion on your site. Use phone_call for a booking made by phone. By using CAPI, you tell Meta this value is accurate.
  • event_source_url is required on website events. It is the page URL where the event happened, and it should match your verified domain.
  • client_user_agent is required on website events. Never hash it. Browsers add it on their own, but your server must add it by hand.
  • client_ip_address should be the visitor’s real address, not your server’s. Never hash it.
  • event_id is optional in the API, but Meta recommends it on every event. Step 5 explains why.

Meta also recommends external_id. Decide that one with your privacy officer before you add it.

Step 5. Add event IDs and deduplicate

If you send the same event from the browser Pixel and from your server, Meta needs a way to count it once. Use the event name and the event ID.

In the browser, add the ID as the fourth argument of the Pixel call:

fbq('track', 'Lead', {}, {eventID: 'EVENT_ID'});

Then follow these rules:

  • The Pixel’s eventID must match the server’s event_id.
  • The Pixel’s event name must match the server’s event_name.
  • Both events must go to the same Pixel ID.
  • Meta only deduplicates when both events arrive within 48 hours of each other.
  • Make the ID unique for each action. An order number or a form submission ID works. If the action has no ID of its own, a random number works, as long as the browser and the server send the same one.
  • Meta generally keeps the first event it receives. If a server event and a browser event arrive within about 5 minutes of each other, Meta favors the browser event.
  • If you send an event only from the server, you do not need deduplication for it.

Meta recommends sending the same events from both the Pixel and CAPI. Whether the browser Pixel runs on a given page is a policy call. Use the callout above for that.

One action, two events, counted onceOne actionA visitor sendsthe contact formBrowser: Meta Pixelevent: LeadeventID: abc123 (example)Your server: CAPIevent_name: Leadevent_id: abc123 (example)Meta compares the pairSame event name + same event IDSame Pixel ID, within 48 hoursCounted onceIf the name or ID differs, Meta counts two events.Server only? You do not need deduplication. Source: Meta Conversions API, Handling Duplicate Events.

Step 6. If you use server-side Google Tag Manager

Meta has a guide for the CAPI tag in server-side Google Tag Manager. Add event_id as a parameter in the Meta tag. Use the same event ID variable your Pixel tag uses. Test in Tag Manager’s preview mode, and add your Test Events code to the tag while you test. Remove the code before you publish.

Part 2: Set Up Google Enhanced Conversions Step by Step

Step 1. Check eligibility and accept the terms

First check each conversion against Google’s customer data policy. The callout above explains where to read more. Then, in Google Ads:

  1. Open Goals, then Settings.
  2. Expand Enhanced conversions.
  3. Check Turn on enhanced conversions.
  4. Read and agree to the customer data terms.

Since April 2026, Google has combined enhanced conversions for web and for leads into one setting. Conversions you import from Google Analytics goals are not supported. Use a Google Ads conversion action with the Google tag or Google Tag Manager instead.

Step 2. Choose how the data reaches Google

You can use the Google tag, Google Tag Manager or the Google Ads API. Since April 2026, Google Ads accepts data from tags and from the API at the same time. Google’s help page for the Google tag still warns that data sent a different way than the method selected in Google Ads may not be processed. Our advice: pick one method for each conversion action and name an owner.

With the Google tag you have three ways to collect data: automatic detection, Cascading Style Sheets (CSS) selectors or JavaScript variables, or a code snippet. Automatic detection inspects the page for strings that match. Automatic detection reads the whole page, so it can pick up fields you did not plan to send. On a health site, choosing the fields yourself with selectors or the snippet gives you more control.

Step 3. Send the right customer fields

Google needs at least one of these:

  • An email address (preferred).
  • A first name, last name, postal code and country.
  • A phone number, sent together with an email or with a full name and address.

You can send plain values and let Google hash them, or send values you hashed yourself. If you hash them yourself, trim spaces, make text lowercase, and write phone numbers in the international E.164 format. That means 11 to 15 digits including a plus sign and the country code, with no dashes, parentheses or spaces. Remove any periods before the domain in gmail.com and googlemail.com addresses. Then hash with SHA-256 (Secure Hash Algorithm 256) and send the result in hexadecimal form.

Step 4. If you upload with the Google Ads API, add an order ID

When you send data through the Google Ads API, the website tag sends only the Google click ID (GCLID) and an order ID. You send the hashed customer data later. Google matches the two by the order ID.

  • Add a transaction ID, also called an order ID, to your website conversion tag. Make it unique for each conversion.
  • Upload the hashed data within 24 hours of the conversion. Google suggests finishing several minutes before the 24 hours end.
  • The conversion action must be at least 6 hours old before you upload to it.
  • Send the GCLID with the upload when you have it. Google does not support enhanced conversions for web when a click carries a gbraid or wbraid value (other Google click IDs) instead of a GCLID.

Step 5. Preview, then go to production mode

If you route through server-side Google Tag Manager, select Preview in the server container. You will see each incoming request, the client that claimed it, the outgoing requests to vendors and the tags that fired. Before you send real traffic, Google strongly recommends installing the server on your own first-party domain and upgrading it to production mode.

Part 3: Test Everything and Keep a Test Log

Use details from your own team for tests. Meta says test events may be discarded if they do not match a Meta account, so its own advice is to use your own details. Meta also says events sent with a test code are not dropped. They flow into Events Manager and are used for targeting and measurement. Never use a patient’s details, and do not test on a page patients use.

What to check, and when (not to scale)Event sent20 minutesEvents show inEvents Manager24 hoursUpload API datawithin this window48 hoursDeduplicationwindow72 hoursGoogle Diagnosticsreport is ready7 daysOldest event_timeMeta acceptsMetaGoogleSources: Meta Conversions API (Verifying Setup, Using the API, Handling Duplicate Events); Google Ads Help and Google Ads API docs.

Test Meta with the Test Events tool

  1. In Events Manager, go to Data Sources, choose your Pixel, then open Test Events. Copy the test code.
  2. Add "test_event_code": "YOUR_CODE" at the top level of your request, next to data.
  3. Send one event from the browser and one from the server. Use the same event name and the same event ID.
  4. Watch the Test Events window. You should see both events, and which one was processed and which was deduplicated.
  5. Read the raw payload your server sent. Check the event name, the page URL and every custom field for health words.
  6. Remove the test code. Meta says it is for testing only.
  7. Send a normal event without the code. It should show in Events Manager within 20 minutes.

Test Google with Chrome Developer Tools

  1. Complete a test conversion on your staging site.
  2. Right-click the page, select Inspect, then open the Network tab.
  3. Type “google” in the search bar.
  4. Find the request to googleadservices.com/pagead/conversion/, or google.com/pagead/1p-conversion/ in some browsers.
  5. Open the Payload tab and look for an em parameter that starts with tv.1~em and is followed by a long string.
  6. If you see only tv.1~em with no long string, the parameter is empty. The customer data was not available when the tag fired.
  7. About 72 hours later, open Goals, then Summary, choose the conversion action and select Diagnostics. About 30 days after a successful setup, impact results appear in your conversion action table.

Your test log

Copy this table into a shared sheet. Fill it in each time you change anything.

TestWhat you should seeResult (pass or fail)Date and tester
1. Browser event with an event IDAppears in Test Events
2. Server event with the same name and ID, plus the test codeAppears in Test Events, and one of the pair is marked deduplicated
3. Raw server payloadNo health words in the event name, page URL or custom fields
4. Test code removed, normal server event sentShows in Events Manager within 20 minutes
5. Google conversion tag on the staging pageRequest to googleadservices.com has an em value with a long string after tv.1~em
6. Google Diagnostics, about 72 hours laterNo alerts for the conversion action
7. API upload only: order ID on the tag matches the uploadNo order ID mismatch alert, and no API errors

Part 4: Troubleshooting

Meta events do not show up

  • Check the test code. In the server-side Tag Manager debugger, if the tag shows Fired: Succeeded, open the tag and confirm the test code is right. Then restart preview mode.
  • Read the error. If the tag shows Fired: Failed, open the Request tab, select the outgoing request to graph.facebook.com and read the response body.
  • Check the Pixel. Look at the Pixel that matches the Pixel ID in your request.
  • Check the date. One event older than 7 days makes the whole request fail.
  • Check the required fields. action_source on every event. event_source_url and client_user_agent on website events.
  • Wait. Meta says events should show within 20 minutes of sending.
  • Check the token link. If you cannot see Generate access token, you may lack developer privileges.
  • Check your firewall. If your business uses a firewall for outbound requests, Meta publishes the addresses its systems use. Check that list.

Events are counted twice, or the deduplication rate is low

Open the Event Deduplication tab for the event. Meta shows the share of events deduplicated from each source and warns you when it is too low. Our guide to optimizing digital health ads uses a rate above 90 percent as a working benchmark. Work through this list:

  • Do the browser and server send the exact same event name?
  • Does the browser eventID equal the server event_id, character for character?
  • Is every ID unique per action? Reused IDs make separate actions look like one.
  • Do both events go to the same Pixel ID?
  • Do both arrive within 48 hours of each other?
  • Does one source send IDs and the other send none? Meta says low Overlap means non-unique IDs, or IDs that come from only one source.
  • Are you deduplicating with fbp or external_id instead? Meta says that method mostly works for a browser event followed by a server event, and a server event is not discarded if no browser event arrived in the past 48 hours.
  • Does your browser conversion fire on a thank-you page view? On Episode 10 of the Marketing Digital Health podcast, Marina Alves, technical lead at Matchnode, said: “When you’re using page views, for example, too, if someone submits the form, gets to that confirmation thank you page, and then they for some reason reload that page, that could count that form submission twice if we use a page view.” She said that “tracking the form submission specifically instead of a confirmation page view is best practice.” She also said that sometimes it is not possible. Check your tag trigger, then test again.

Event Match Quality is low

Event Match Quality (EMQ) is Meta’s score, from 1 to 10, for how well your server event’s customer details may match a Meta account. Treat it as a diagnostic. Our guide to optimizing digital health ads lists 7.0 or higher as a benchmark. Meta’s own guidance is to aim for 6.0 or higher. Use a low score as a reason to look for mistakes. Do not use it as a reason to add identifiers you would not otherwise send.

Event Match Quality fix list: work down this list before you change anything else

1. Send the Internet Protocol (IP) address and user agent on every server event.
Use the visitor’s real IP address, not your server’s. Meta says sending both may help event matching.
2. Pass fbp and fbc from the browser to the server.
Send them unchanged and refresh them regularly. They are Meta’s browser ID and click ID cookie values.
3. Check formatting before you hash.
Trim spaces and make emails lowercase. Write phone numbers with the country code and no symbols.
4. Remove combinations Meta treats as invalid.
Events that carry only broad fields, such as city, state, zip code and gender, or date of birth with user agent, are invalid.
5. Open the score in Events Manager.
Click the Event Match Quality score for the event and read Meta’s recommendations.
6. Stop and ask before adding any identifier.
Do we already hold it in a flow our privacy officer has approved? If not, leave it out. A low score is not a reason to send more.

Sources: Meta Conversions API, Best Practices and Customer Information Parameters. Step 6 is Matchnode’s own advice.

Google enhanced conversions errors

What you seeLikely causeWhat to do
CUSTOMER_NOT_ACCEPTED_CUSTOMER_DATA_TERMSThe customer data terms are not accepted for this accountAccept them in Google Ads: Goals, Settings, Enhanced conversions
CONVERSION_ACTION_NOT_ELIGIBLE_FOR_ENHANCEMENTEnhanced conversions is not turned on for that conversion actionCheck Turn on enhanced conversions on the conversion action
CONVERSION_ALREADY_ENHANCEDThe same order ID was uploaded twice for that conversion actionSend a unique order ID for each conversion
INVALID_USER_IDENTIFIERA hashed field is not a valid 64-character SHA-256 hexadecimal valueNormalize first, then hash. Re-run the upload
TOO_RECENT_CONVERSION_ACTIONThe conversion action is less than 6 hours oldWait until it is at least 6 hours old, then upload
Order ID mismatch alert in DiagnosticsThe order ID on the tag and the order ID in the upload do not match, or the tag sends noneSend the same transaction ID in both places
em shows only tv.1~em in Developer ToolsThe parameter is empty. Customer data was not on the page when the tag firedMake the data available before the tag fires
API route: enhanced conversions not applied to some clicksThe click carried a gbraid or wbraid value (other Google click IDs) instead of a GCLIDThis is a Google limit, not a setup error. Plan for it

Part 5: Weekly Monitoring

Setup is not the finish line. Put these checks on a weekly calendar and give each one an owner. Also compare platform numbers with your own records, such as booked appointments in your scheduling system. For which numbers to track, see digital health marketing metrics.

CheckWhere to lookWhat good looks likeHow often
Events receivedEvents Manager, your Pixel, OverviewCounts look normal for your traffic. Connection Method shows both Browser and Server if you use bothWeekly
Event freshnessOverview, Event Details, Event Freshness tabAverage delay stays close to real timeWeekly
DeduplicationEvent Details, Event Deduplication tabNo low-rate warning. Our benchmark is above 90 percentWeekly
Event Match QualityOverview, then click the scoreScore is steady. Read Meta’s recommendations. Do not add identifiers only to raise itWeekly
Google diagnosticsGoals, Summary, your conversion action, DiagnosticsNo alerts. If you use the API, check offline data diagnostics tooWeekly
Platform numbers versus your recordsYour scheduling system or customer relationship management (CRM) systemBooked appointments are close to platform conversions, and you can explain any gapWeekly
Rules and changesMeta Business Tools Terms and Google customer data policyReviewed, and your event list still fits. Review again when you add an event, form or vendorMonthly, and at every change

Need a Second Set of Eyes?

Matchnode defaults to Ours Privacy, a customer data platform (CDP) built for HIPAA, for server-side setups.

If you would like help with your setup or your test log, see our technical services or contact Matchnode.

Sources: Meta Conversions API documentation (Get Started, Using the API, Server Event Parameters, Customer Information Parameters, Handling Duplicate Events, Verifying Setup, Best Practices, and the guide for server-side Google Tag Manager); Google Ads Help (set up enhanced conversions for web using the Google tag); Google Ads API documentation (manage online click conversions); Google Tag Manager server-side documentation (introduction, and preview and debug). Benchmarks marked as ours come from Matchnode’s guide to optimizing digital health ads.

Frequently Asked

Questions, Answered

Do we still need the browser Pixel?
Meta recommends sending the same events from both the Pixel and CAPI. For a health site, decide page by page, and use the callout above for the policy side. If you send the same event both ways, set up deduplication. To see why browser tracking is getting weaker, read our guide to HIPAA-safe retargeting without pixels.
Do we need deduplication if we only send events from the server?
No. Meta says you only need it when you send the same event through both the Pixel and CAPI.
How long until we can see results?
Meta says events should show in Events Manager within 20 minutes. Google's diagnostics report is ready about 72 hours after you set up enhanced conversions, and impact results appear after about 30 days.
Can we use Google enhanced conversions?
Check first. Google says conversions related to health or medical information can't be used in enhanced conversions. Confirm with Google and your counsel, and read our attribution guide for more.
What Event Match Quality score should we aim for?
Use it as a diagnostic, not a goal. Fix formatting and missing basics first. Do not add identifiers only to raise the number.

Let's Improve Your New Patient Acquisition

Contact Us