Skip to content
Dericson Calari
Back to the blog
Capa do artigo: How to test a API of Meta Conversions and validate an event

How to test a API of Meta Conversions and validate an event

Test a API from Meta Conversions to Event Manager and check out destination, time, payload, and deduplication with Pixel.

Foto de Dericson Calari

Published on5 min read

When someone tells me that a API of Conversions is working because the sending gave HTTP 200, my next question is which event arrived, in which source and by what action? To answer, use Test events in the Event Manager and follow a controlled case from its base to the Meta.

This step by step is for event Web. The parameters and the origin need to reflect the channel in which the action happened. A closed purchase in message requires the contract of the corresponding channel. Parameters of API of Conversions

How to check a shipment of the API of Conversions

Choose action and test source
Send with test code
Check the Source Server
Validate data and deduplication

1. Separate the traffic test event that optimizes campaigns

Choose a controlled action that you can repeat. In a store, it can be a sandbox order. Save ID, status, value, currency, and time to your base. Use a test source that doesn’t feed real campaigns when sending synthetic purchases.

The field test_event_code makes the activity appear in Test events. Meta’s documentation states that the events marked continue to be processed and can be used for measurement and segmentation. Using the code in a production source, by itself, does not isolate the data. Meta's Test Events Tool

2. Take the code at the source that should receive the event

In the Event Manager, open Data sources, select the set that will receive the test and enter Test events. Copy the code that Meta shows for server sending. Compare the ID of this font with the ID configured on your connector.

The code test_event_code goes in the body of the request, at the same level of data. If you use a ready-made integration, look for the provider-documented test shipping option. In a connector of your own, register response status, identifier of your attempt and event ID, without putting credentials or raw personal data in the logs. Structure of the request body

3. Confirm in the panel what has arrived

Fire the chosen action. In the test, locate the time event and check if the connection method is Server. Compare the name to the action. Your purchase flow may have done InitiateCheckout correctly and failed only in the Purchase.

For one Purchase Web, validate the following in your submission and the details available in the dashboard.

  • Destination and origin. The data set is that of the test and action_source It represents the real channel.
  • Schedule. event_time represents when the action happened, in Unix seconds. The workflow execution time may be later than the payment.
  • Value and currency. Compare the value of the test order and the currency with custom_data. A value in cents sent as reals changes the revenue even with the event received.
  • Identifier. Use event_id coherent by action. If there is retry of the same purchase, the integration needs to recognize the same order.
  • URL and signs allowed. Check the parameters required for Web source and the treatment rules applicable to each field. Use only data allowed in the context of the test. Meta Parameter Reference

For example, a test request of R$ 79,90 must arrive with the currency BRL and value 79,90 in the panel, corresponding to 79.90 as number on payload. If it arrives 7.990, adjust the conversion of cents in the integrator and repeat with a new test request.

4. Test the same action by browser and server

When Pixel and API represent the same Purchase, send the same data set the same event name and the same ID for this action. In the browser the field is eventID. On the server, it is event_id.

Set up a conference with two separate requests. In each request, the two sides must agree on the ID. Requests should have different IDs. So you take both the duplication of a single purchase and the error of repurposing a fixed ID for all. Then check out the deduplication in the event details of the Event Manager. Pixel and da deduplication rules API

How to Locate Error by Evidence

  • The action took place and the connector did not attempt to send — check the trigger, status filter and queue.
  • The connector tried, but a API rejected — read the returned error and review authorization, destination and parameters. Avoid generating another token before you know the cause.
  • Received in the API, absent in Test events — check the data set, code at the correct level, time and filter of the dashboard.
  • Received in the dashboard, wrong value — return to the origin of the price, the unit and the currency.
  • Received, no credit in the campaign — this reading requires checking the eligibility, filters and the allocation window. The receiving test resolves another part of the audit. Configuration check and event quality

What to check when you exit the test

Remove test_event_code of the production configuration. Confirm that the destination has been set to the right context and observe a real case that happened naturally, without firing synthetic purchase in active campaign. Check volume, delay and deduplication at the source. To structure this path from the collection itself, see the map of first-party data collection and conversion tracking.

Frequently Asked Questions

Can I send the test code within the event?

Pass test_event_code in the main object, next to the array data. The fields of each action are within the corresponding item in data.

Does the event appear as Server prove deduplication?

Proves arrival by server. To check for deduplication, compare the ID and name to the same action in browser and server and see the font deduplication details.

A high match note confirms that a API is it correct?

The note deals with the ability to associate the event with an account. Also validate if the event represents the right action, contains the right value and arrives at the right time.