On this page
What this issue is
In Meta Events Manager, the Test Events tab gives you a code such as TEST12345. You add it to Conversions API requests as the test_event_code parameter so Meta shows your server events live in that tab while you debug.
The problem starts when the code is left in the production setup. Meta documents that events sent with a test code are for testing only and are not used for ad delivery or optimisation. Your real leads and purchases keep flowing, but Meta treats them as tests.
The code is a CAPI feature. It lives in the server request body, in a plugin or integration field, or in a server-side Google Tag Manager tag. The browser pixel does not use it.
{
"data": [
{
"event_name": "Lead",
"event_time": 1735689600,
"action_source": "website",
"event_id": "lead_8841",
"event_source_url": "https://example.com/thank-you"
}
],
"test_event_code": "TEST12345"
}Why it costs you leads or sales
Meta optimises delivery using the conversion events it receives. If your server events are flagged as tests, they do not feed that system. The browser pixel may still report the same conversions, so the damage is often partial and easy to miss.
What you may see: fewer conversions in Ads Manager than in your CRM, a weaker Event Match Quality picture because server data is missing, deduplication that never happens, and campaigns that learn from less data. If the browser pixel is also blocked by browsers or consent tools, the loss is bigger.
- Visitor submits formReal lead, real revenue potential
- Server sends CAPI eventRequest still contains test_event_code
- Meta treats it as a testShown only in Test Events tab
- Ad optimisationLearns from less conversion data
The visitor converts normally, but the server event is tagged as a test and never reaches optimisation.
Example: 100 real leads a week. With the code left in, only the browser pixel's share is counted; after removal, server events count again.
How to check if your site has it
Open Events Manager
Go to Meta Events Manager, pick your dataset (pixel), and open the Test Events tab.
Trigger a real conversion
Submit your live form yourself, using a normal browser session, without the test code being typed in anywhere.
Look for the server event in Test Events
If a Server event for your Lead or Purchase shows up in the Test Events tab without you starting a test session, a test code is being sent.
Compare Overview with your CRM
In the Overview tab, check whether Server events are low or absent compared with Browser events and your real lead count.
Search your code and settings
Search your codebase, plugin settings and server-side tag settings for
test_event_codeand for your TEST code string.
grep -rn "test_event_code" --include=*.php --include=*.js --include=*.ts --include=*.py --include=*.json .How to fix it
The fix is to delete the test code from every place that sends CAPI events, then deploy. The exact location depends on how your CAPI is set up.
Open your Meta plugin settings
Check the Meta/Facebook plugin or your CAPI plugin (the menu name varies by plugin). Look for a field named Test Event Code or similar.
Clear the field and save
Delete the code, save, then clear any page or object cache.
Check the Meta channel or Facebook & Instagram app
If you use Shopify's native Meta integration, the test code is not set in the theme. Check any extra CAPI app you installed for a test code field.
Remove it in the app and any custom code
Clear the field, and search theme or custom pixel code for test_event_code.
Open your server container
In server-side GTM, open the Meta Conversions API tag.
Empty the Test Event Code field
Remove the value or any variable that fills it, then Save.
Publish the container
Preview first, then Submit and publish. The tag only changes in production after publishing.
Find the parameter
Search for test_event_code in your server code and environment variables.
Make it conditional
Only add it when a non-production environment variable is set, so production never sends it.
const payload = { data: events };
if (process.env.NODE_ENV !== 'production' && process.env.META_TEST_EVENT_CODE) {
payload.test_event_code = process.env.META_TEST_EVENT_CODE;
}How to confirm it's fixed
- Search code, plugin settings and server tags again: no test_event_code remains.
- Submit a real test conversion on the live site.
- In Events Manager Overview, the Server event appears within a few minutes to hours.
- The event shows as received from both Browser and Server and is deduplicated if event_id matches.
- No unexpected server events show in the Test Events tab.
- Over the next days, Server event counts roughly follow your CRM lead counts.
Test code left in
- Server events appear only in Test Events
- Overview shows few or no Server events
- Ads Manager conversions lower than CRM
Test code removed
- Server events appear in Overview
- Browser and Server events deduplicate
- Ads Manager conversions track CRM more closely
How to prevent it happening again
- Put the test code in an environment variable used only on staging.
- Add the removal of the test code to your launch or release checklist.
- Never paste the code straight into production tag or plugin settings; use a preview or staging container.
- Review the Overview tab for Server events after any CAPI change.
- Note who set up CAPI and where the code lives, so the next person knows where to look.
How FunnelGuard handles this
FunnelGuard does not check for a leftover test event code today. It is a possible future check. The reason is that the code sits in server-to-server requests, which a robot visitor browsing your site cannot see.
What FunnelGuard does check nearby: it runs your real journeys, such as a lead form, on a schedule and checks the tracking hits sent from the browser to ad platforms including Meta, plus whether test leads reach your inbox and CRM. If the browser Lead hit disappears, that kind of break can be caught. A test code on the server side would not be.
To watch for it yourself, open the Test Events tab and the Overview tab in Events Manager after every CAPI change, and compare Server event volume with your CRM lead count each week. You can also search your code and tag settings for test_event_code as part of releases.
Questions people ask
What is a Meta test event code?
It is a code such as TEST12345 shown in the Test Events tab of Meta Events Manager. You add it as test_event_code to Conversions API requests so your server events show live in that tab while you debug.
Why are my Meta Conversions API events only showing in the Test Events tab?
Your requests are probably still sending a test_event_code. Meta treats events with that code as tests, so they appear in the Test Events tab and are not used for reporting or optimisation. Remove the parameter from your server code, plugin or server-side tag.
Does a leftover test event code affect ad optimisation?
Yes, for the events sent with the code. Meta documents them as test traffic, so they do not feed delivery or optimisation. The browser pixel may still report conversions, which can hide the problem.
How do I remove the test event code from Meta CAPI?
Delete the test_event_code field wherever CAPI is configured: server code, a WordPress or Shopify plugin field, or the Test Event Code field in a server-side GTM tag. Then publish or deploy and send a real conversion to confirm.
How do I know if the test code is still in my live setup?
Submit a real conversion without starting a test session. If a Server event shows up in the Test Events tab, or Overview shows few Server events compared with your CRM, a test code is likely being sent. Also search your code and tag settings for test_event_code.
Does the test event code affect the browser Meta Pixel?
No. It is a Conversions API parameter. The browser pixel does not use it, so browser events continue as normal.
Can FunnelGuard detect a leftover Meta test event code?
Not yet. It is a possible future check. FunnelGuard checks browser-side tracking hits and lead delivery on your journeys, but server-side CAPI payloads are not inspected, so use Events Manager to monitor this.
Related issues
- TRK-180CAPI events missing entirelyFix guide
- TRK-179CAPI not deduplicating with browser event (event_id mismatch)Fix guide
- TRK-178event_id missing on browser eventsFix guide
- TRK-182CAPI sending event_source_url of stagingFix guide
- TRK-168Two Pixel IDs firing, events splitFix guide
- TRK-190Domain not verified in Business ManagerFix guide