Skip to content
Dericson Calari
Back to the blog
Capa do artigo: GPT Ads Tutorial: How to Configure a API from Conversions Step by Step

GPT Ads Tutorial: How to Configure a API from Conversions Step by Step

Learn how to configure a API of GPT Ads Conversions, send server to server events, implement deduplication, and use data to optimize campaigns.

Foto de Dericson Calari

Published on22 min read

The GPT Ads opens a new front for advertisers interested in reaching users within artificial intelligence-based experiences. However, just as with other media platforms, running ads is just part of the process. To evaluate results and improve campaigns, you will need to implement a reliable measurement framework.

In This GPT Ads Tutorial, you will understand how to prepare an integration with the API conversions of GPT Ads, send events directly from the server, avoid duplicate conversions, and turn the collected data into optimization decisions. The content was designed for traffic managers, analysts and marketers, without requiring advanced development knowledge.

Because the platform and its documentation can receive frequent updates, the exact names of endpoints, fields, and credentials must be confirmed in the official documentation available in the advertiser’s account. The examples in this tutorial represent a implementation architecture and must be adapted to the current version of the API.

“On a new platform, the best competitive advantage is not to implement everything in a hurry, but to build a documented, testable, and change-ready data collection.

First contact with GPT Ads tracking

In the reference video, Dericson Calari analyzes the first contact with the tracking proposal of GPT Ads and highlights that its structure tends to follow fundamentals already known in conversion APIs. The easiest parallel is with the Meta Ads: a business event is captured, enriched with identifiers and sent to the platform for assignment and optimization.

The video also reinforces an important point: news related to artificial intelligence evolves rapidly. Therefore, tracking professionals should study the documentation instead of relying only on tutorials produced soon after launch. A tutorial helps to understand the logic, but the official documentation remains the benchmark for parameters, limits and policies.

Another relevant insight is the need to measure not only the final sale, but also the performance of pages, forms and other stages of the journey. This allows you to understand if the traffic originated by ChatGPT experiences generates qualified visits, leads, opportunities or customers.

What is a API of GPT Ads Conversions?

One API of Conversions is a channel used to transmit events from your environment to the ad platform. Instead of relying solely on a script executed in the browser, the company's server informs that an action has occurred. This communication is often called integration server-to-server or server-side.

In practice, when a visitor fills out a form, initiates a subscription or completes a purchase, the system responsible for the data — website, CRM, checkout or automation tool — prepares an event and sends it to the API. GPT Ads can use this information for measurement, assignment, reporting, and campaign learning, according to the resources officially made available.

Why not just depend on the browser?

Browser-only events may be affected by blockers, loading failures, page closure, cookie restrictions and privacy settings. Sending through the server reduces some of these losses because it uses a source closer to operational truth, such as the order bank or the CRM.

  • Increased reliability: the event can be fired after actual confirmation in the system.
  • Quality control: data can be validated before shipping.
  • Enrichment: CRM and checkout can add status, value and identifiers.
  • Recovery: Temporary failures can be resubmitted automatically.
  • Governance: logs help to find out when, why and which event was broadcast.

This does not mean that the server-side tracking is foolproof. If the integration sends events without standardization, repeats purchases or uses incorrect data, the platform will receive a distorted view. The quality of measurement depends on both technology and business rules.

Recommended architecture for tracking

Before creating a request, draw the path taken by the data. The implementation should start at the origin of the action, go through a validation layer and finish in the API. A bank or intermediate registration is recommended to control attempts, responses and deduplication.

GPT Ads Server-to-Server Flow

User interacts with ad or page
Site registers UTMs and permitted identifiers
CRM or checkout confirms the conversion
Server or n8n validates and normalizes the event
API of Conversions hosts the event
Logs record response, error or re-send

This flow separates Capture, confirmation and Transmission. The page captures the context of the visit, the business system confirms the result and the integration transmits only what meets the defined criteria. That way, a click on the button does not have to be confused with an effectively approved sale.

Prerequisites for following the GPT Ads Tutorial

The availability of credentials and resources may vary depending on the release of GPT Ads. Before you implement, check in the dashboard and official documentation if your organization has access to the ad account, to API, the necessary identifiers and the testing environment, if it exists.

  • Account or organization qualified for the GPT Ads.
  • Access to the current documentation of the API of Conversions.
  • Authentication credential stored securely.
  • Account identifier, data source or equivalent set.
  • Domain and pages with campaign parameters configured.
  • CRM, checkout or bank able to confirm conversions.
  • Server, cloud function or automation in the n8n.
  • Privacy policy and legal basis appropriate to the treatment carried out.

It is also important to define who will be responsible for marketing, technology, privacy and financial validation. One API may be technically working and yet measure wrong results because no one has defined when a business should be considered gain.

Step 1: Define which conversions will be sent

Don't start with the tool. First, list the results that guide the campaign. A demand generation business can accompany qualified visit, registration, lead accepted, scheduled meeting, opportunity and sale. An e-commerce can work with product, cart, checkout and purchase viewing.

Each event should have an objective definition. For example, Lead may mean a valid form with telephone and consent, while QualifiedLead may represent a contact that has met minimum criteria in the CRM. Without this dictionary, different departments will interpret the same indicator in incompatible ways.

Create a dictionary of events

  • Name of the event: Nomenclature accepted by API or custom name allowed.
  • Trigger: exact action that confirms the occurrence.
  • Origin: website, checkout, CRM, application or service.
  • Responsible: system or team that owns the data.
  • Required fields: time, ID, origin and necessary identifiers.
  • Cancellation rule: treatment for chargeback, test or duplicity.

If you already use UTMs in the Meta Ads, the standardization logic will also be useful in GPT Ads. The article Tutorial UTMs Facebook shows how to structure consistent parameters, which can be adapted to preserve origin, campaign, set or creative variation.

Step 2: get and protect authentication

Conversion APIs typically require a token, key, or credential associated with the organization. Refer to the current documentation to identify the mechanism actually adopted by GPT Ads. If a Bearer-type token is used, it is usually sent in the authorization header, but this syntax must be officially confirmed.

Never put the credential in the public code of the site, in the Google Tag Manager web, in open spreadsheets or in URL parameters. Authentication must remain on the server, in a secret vault, protected environment variable or encrypted credential of the n8n.

  • Create separate credentials for production and approval, if support.
  • Only grant the necessary permissions to submit events.
  • Register who created and who can replace the credential.
  • Define a process of periodic rotation.
  • Immediately revoke exposed tokens.
  • Never display the key in screenshots or logs.
“A credential of API should be treated as an administrative password: stays on the server, has minimal access and can be replaced without interrupting the entire operation.

Step 3: locate endpoint, version and headers

In the official documentation, look for the section intended for the creation or sending of conversion events. Register a Endpoint URL, the HTTP method, the version, the headers, the body format, the batch limits and the response codes.

A typical call of API use the method `POST`, content in `application/json` and an authentication header. However, it is not safe to assume that the definitive endpoint will follow exactly this pattern. Use values such as `URL_OFICIAL_DE_EVENTOS` and `TOKEN_SEGURO` during planning and replace them only after checking your account documentation.

Information that must be recorded

  • Version of the API used by integration.
  • Method and official address of the endpoint.
  • Format of authentication.
  • Mandatory and optional fields.
  • Timestamp spin and unit.
  • Maximum amount of events per lot.
  • Policy of attempts and limit of requests.
  • Maximum deadline accepted for retroactive events.

Documenting this information prevents automation from relying on a single person’s memory. It also makes it easy to review when OpenAI releases a new version or changes some parameter.

Step 4: mount the event payload

The payload It is the body of the request. It describes what action occurred, when it happened, where it came from and what data might help in the correspondence. The names below are conceptual; adapt them to the official GPT Ads scheme.

  • `event_name`: Standardized name of conversion.
  • `event_time`: date and time according to the required format.
  • `event_id`: unique identifier used in control and deduplication.
  • `action_source`: origin of the action, as a website, CRM or application.
  • `event_source_url`: conversion-related page, where applicable.
  • `user_data`: Identifiers allowed and processed according to documentation.
  • `custom_data`: value, currency, product, order or commercial information.
  • `campaign_data`: UTMs and accepted assignment identifiers.

An illustrative example would be: `{"event_name":"Purchase","event_time":"TIMESTAMP_VALIDO","event_id":"order_84721","action_source":"website","custom_data":{"currency":"BRL","value":497.00}}`. This fragment does not represent an official specification; its purpose is to show the logical organization of an event.

Prefer to send the Really confirmed value, and not just the price displayed on the page. If there is discount, shipping, installment, cancellation or different currency, establish a clear financial rule. Revenue inconsistencies can lead to misguided decisions about return on investment.

Step 5: process the identification data

The platform may request identifiers to relate the event sent by the server to an advertising interaction. What data is accepted, mandatory or hashed must be confirmed in the documentation and under the GPT Ads.

When the hash is required, normalize the data before applying the indicated algorithm. An email, for example, may need to be converted to lowercase letters and have spaces removed. Phones typically require country code and only digits. Applying hash to poorly formatted information preserves error and reduces the possibility of matching.

  • Collect only information necessary for the stated purpose.
  • Do not send sensitive data or prohibited fields.
  • Apply normalization in a deterministic way.
  • Use exactly the algorithm specified by the platform.
  • Maintain consent, transparency and retention policy.
  • Involve the legal or privacy officer in the implementation.

Technical implementation is not a substitute for conformity assessment. The company remains responsible for the treatment carried out, including when using automations, cloud vendors or ad platforms.

Step 6: implement event deduplication

A Deduplication prevents the same conversion from being counted more than once. It is indispensable when the event can reach two paths, such as browser and server, or when automation repeats a request after a network failure.

The most common strategy is to generate a `event_id` stable at the origin. If the browser sends the purchase `order_84721`, the server must use exactly the same identifier for that purchase. The platform may recognize that the two records represent the same occurrence, provided that the GPT Ads offers this logic and the fields are in accordance with their documentation.

How to create one event_id reliable

For purchases, the internal order number is usually a good base, as long as it is unique and does not expose undue information. To leads, a UUID generated in the first valid shipment can be used. Avoid using only email, as the same person can perform legitimate conversions at different times.

  • Generate the ID once in the origin.
  • Save the amount in the bank, CRM or request.
  • Reuse the same ID on all channels of the same event.
  • Do not create a new ID with each re-shipment attempt.
  • Keep different events with different identifiers.
  • Record the ID in the logs to facilitate audits.

Consider a purchase transmitted by the browser to 14h02 and by the server to 14h03. If the two submissions carry the same event name and identifier, the platform can treat them as a single conversion. If the server generates a new random ID, there is a risk of recording two purchases.

There is also the exclusively server-side duplication. It occurs when a webhook is delivered twice, an operator repeatedly changes the status of the CRM or the stream interprets a time-consuming response as failure. Therefore, its own integration must maintain a Key of identification, regardless of the deduplication performed by the platform.

“The principle of idempotence is simple: repeating the same attempt may be necessary, but repeating the business outcome cannot create a new conversion.

Step 7: make the server to server

With defined credential, endpoint, and payload, your server can file the request. The flow must validate the fields, serialize the JSON, add the headers, and save both the attempt and the response received.

Do not consider an event delivered just because the system has executed the shipment. Analyze the HTTP code and, above all, the body of the response. Some APIs return partial success: the batch is received, but certain records feature invalid fields.

How to treat answers and failures

  • Accepted response: mark the event as sent and store the returned identifier.
  • Validation error: fix the mapping; do not automatically repeat an invalid payload.
  • Authentication error: stop the flow and check token, permission or expiration.
  • Limit of requests: Wait for the indicated period before trying again.
  • Temporary failure: use new attempts with progressive intervals.
  • Timeout: consult the local record before resending to avoid duplicity.

A best practice is to use Expedine backoff: the first new attempt occurs after a short interval and the following progressively wait longer. Add a limit of attempts and send definitively rejected events to an analysis queue.

How to configure the integration in the n8n

For teams that do not wish to develop a complete application, the n8n It can work as an integration layer. It receives webhooks, queries CRMs, transforms fields, creates IDs, executes HTTP calls, and logs responses.

The logic is similar to that used in other conversion APIs. In the article How to use n8n to track conversions of the WhatsApp, you find a structure that can serve as a reference for webhooks, treatment and server-side shipping.

Suggested workflow structure

  • Use a knot Webhook to receive the conversion.
  • Validate secret, signature or origin of the request.
  • Consult the CRM or request to confirm the status.
  • Use Set or Code nodes to normalize the fields.
  • Research the `event_id` in the bank before proceeding.
  • Make the call on the knot HTTP Request.
  • Record status, response and number of attempts.
  • Create an error route for alerts and reprocessing.

In HTTP Request, configure the method and endpoint exactly as published by the documentation. Add protected credential authentication, select JSON as the body format, and map webhook values. Avoid typing the token directly into multiple nodes.

For internal deduplication, the workflow can refer to a table by `event_id`. If there is already a record with accepted status, the flow ends. If it is pending or temporarily failed, it checks the reshipment rules before calling a API again.

If your operation receives conversions by WhatsApp, it is also worth consulting the RastrackApp Tutorial and the Pixel Message Tutorial. These contents help structure the connection between campaign, conversation and business outcome.

Step 8: test before sending real events

Start with a test environment, test identifier, or equivalent feature if available. If the platform still doesn't offer sandbox, use clearly marked events and follow the official guidance not to contaminate reports.

Create controlled scenarios: one lead valid, an incomplete form, an approved purchase, a declined purchase and two shipments with the same ID. This allows you to check whether the rules distinguish real occurrences from operational noise.

Validation checklist of the API of Conversions

Protected and minimum accessed credential
Endpoint and version confirmed in the documentation
Schedule sent in the correct format and spindle
Event_id persistent and unduplicated
Standardized data as specified
Answers and errors stored in logs
Limited and progressively intervald retentations
Events compared to CRM or checkout

After the unit test, perform a reconciliation. Compare, for the same period, how many conversions there are in the source system, how many were sent, how many were accepted, and how many appear in the reports. These quantities may not be identical because of assignment and processing, but large differences need to be investigated.

Practical example 1: capture of leads

Imagine a company that announces a free diagnosis. The user accesses the landing page, the parameters of the campaign are stored and the form sends the data to the CRM. At this time, the server generates a UUID for the lead.

Automation validates whether the required fields have been filled, normalizes the permitted identifiers and sends an event of lead à API. The UUID is registered in the CRM and in the tracking table. If the webhook is repeated, the integration recognizes the same ID and does not create another conversion.

When the commercial team classifies the contact as qualified, a second event can be sent, if this internship is accepted by the platform. Thus, optimization stops looking only at forms and starts to consider closer signs of revenue.

To make this qualification objective, implement profile and intent criteria. The content on How to create a system of lead score presents a useful methodology to organize this evolution.

Practical example 2: purchase confirmed

In a sales operation, the click on the payment button should not represent a purchase. The reliable trigger is confirmation of the gateway or financial system. After approval, the server consults the request and prepares the event.

The `event_id` may be derived from the internal identifier of the application, while `value` receives the value effectively recognized and `currency` inform the currency. The UTMs and other permitted identifiers must have been preserved since the initial visit.

If the payment changes from pending to approved, only the approved event is sent. If the gateway repeats the notification, the power key prevents further accounting. For cancellations or refunds, please confirm that a API offers specific events or mechanisms before implementing any adjustment.

Practical example 3: conversion originating in the WhatsApp

Campaigns that direct users to WhatsApp require a bridge between the click and the CRM. The URL or the intermediate page may record source parameters, while the service associates this information with the contact.

When the sale is completed, the CRM triggers the n8n, which consults the initial record, assembles the event and calls the API. This architecture allows you to analyze not only how many conversations were started, but how many opportunities or sales became.

The primary care is to maintain a consistent identifier during the journey. If the origin is lost upon entering the WhatsApp, the final conversion may exist in the CRM, but will not have enough context for campaign analysis.

How to use data to optimize campaigns

Sending events is just the beginning. Intelligence appears when the company differentiates quality volume. One campaign can generate many leads cheap and few sales; another may have higher CPL, but produce superior revenue.

Follow the full funnel

  • Visit fee for lead.
  • Rate of lead to lead qualified.
  • Rate of lead qualified for opportunity.
  • Opportunity fee for sale.
  • Cost per conversion at each stage.
  • Revenue and margin allocated per campaign.
  • Average time between click and closing.

When the platform allows you to select optimization events, choose the one that has sufficient quality and volume. Optimizing directly for sale may be ideal in theory, but an account with few sales may need to start with a well-correlated intermediate stage with revenue.

Analyze quality of correspondence

If GPT Ads provides matching or diagnostic indicators, follow them closely. Low quality may be associated with missing fields, incorrect normalization, loss of UTMs, inconsistent schedules, or unallowed data.

Do not attempt to increase correspondence by sending information indiscriminately. The goal is to transmit correct, necessary and authorized data. More data They do not automatically mean Better data.

How to deal with updates and instability

The video draws attention to the possibility of rapid changes, something common in products related to artificial intelligence. Robust integration should assume that versions, fields, boundaries, and behaviors can evolve.

  • explicitly fix the version of the API, when possible.
  • Follow up on official changelogs and warnings.
  • Test changes in approval before production.
  • Avoid spreading URLs and tokens across multiple systems.
  • Centralize mapping in an integration layer.
  • Create alerts for increased errors and falling events.
  • Keep a queue to reprocess temporary failures.

A centralized layer facilitates maintenance. If a field changes, you fix the mapping in a single stream, without editing the site, the CRM and the checkout separately.

GPT Ads and Meta Ads: similarities and differences

Comparison with the Meta Ads is useful to understand concepts such as event, origin, identifiers, payload, correspondence and deduplication. Professionals familiar with a API of Goal Conversions will recognize much of the operational reasoning.

However, this does not mean that the two APIs are interchangeable. Event names, authentication, windows, privacy rules, formats and optimization possibilities may be different. Copying a request from the Meta Ads and just changing the URL is an inappropriate approach.

Use the previous knowledge as Mental Model, not as specification. The GPT Ads documentation must prevail whenever there is a divergence.

Common errors when implementing a API

  • Copy unofficial examples without confirming the version.
  • Expose the credential in the browser or in a public repository.
  • Generate a new event_id with every attempt.
  • Send click on the button as if it were a sale.
  • Ignore time zone and timestamp unit.
  • Apply hash before normalizing the data.
  • Repeat invalid requests indefinitely.
  • Do not compare a API with the system of origin.

Another frequent error is to activate all events simultaneously. This increases the difficulty of diagnosis. Start with a central conversion, validate the end-to-end flow, and then expand the implementation.

Monitoring and governance

A precise production integration of continuous monitoring. Create a dashboard with incoming, accepted, rejected, duplicate, pending, and reprocessed events. Also follow the time between the occurrence and the shipment.

Set up alerts for abrupt drops, increased authentication errors, limit responses, and queue buildup. A broken form, revoked token or node disabled in the n8n can interrupt measurement without visually affecting the campaign.

In logs, avoid storing personal data in open text. Prefer internal identifiers, technical status, and sanitized messages. Determine how long the records will be kept and who can access them.

Recommended deployment plan

A gradual deployment reduces risk and improves learning. In the first phase, map the funnel and confirm the resources released. On Monday, implement a high-confidence event. In the third, reconcile the numbers and assess stability.

Only after validation, connect intermediate events, CRM, WhatsApp and signs of quality. Finally, document the criteria used in campaign decisions not to confuse correlation with causality.

“The best tracking is not the one that sends more events, but what faithfully represents the real funnel and allows you to explain each number.

FAQ about the GPT Ads Tutorial

What is a API of GPT Ads Conversions?

It is the mechanism intended to send conversion events to the ad environment through an integration. Availability, resources and exact format must be verified in the official account documentation.

I need to be a developer to configure a API?

Not necessarily. Tools such as n8n they can simplify implementation. Even so, it is necessary to understand authentication, HTTP requests, JSON, security, deduplication and error handling.

A API completely replaces browser tracking?

Not mandatory. The two forms can be complementary. If both send the same conversion, implement the deduplication with the identifier indicated by the documentation.

What happens if I don't use event_id?

You lose an important reference for control, audit and deduplication. In browser, server, or retentative scenarios, this can increase the risk of duplicate conversions.

Can I send personal data without hash?

Strictly follow the documentation, platform terms and applicable obligations. When a particular identifier requires normalization and hash, use the official procedure. Do not send prohibited or unnecessary fields.

How do you know if the event was received correctly?

Analyze the code and body of the response, see diagnoses available in the dashboard, and compare accepted events with CRM or checkout. Only running the request does not guarantee that all fields have been processed.

How to avoid duplication in webhooks?

Persist a unique identifier, consult it before processing, and maintain the same value during retentatives. Mark the status of the event and do not repeat already confirmed records.

The structure of API is equal to that of the Meta Ads?

The fundamentals may be similar, such as server-side shipping and deduplication, but the specification should not be presumed to be equal. Check endpoints, fields, authentication, and policies directly in the official GPT Ads material.

Conclusion

This GPT Ads Tutorial presented the way to plan an integration with the API of Conversions: set events, protect credentials, mount payloads, normalize data, implement deduplication, send server information to server, and monitor responses.

The main learning is that tracking is not just about making a request work. A reliable structure needs to correctly represent the business, survive temporary failures, prevent duplication and transform results from CRM or checkout on useful signals for the campaigns.

As the GPT Ads can undergo changes, track the documentation and validate all implementation in a controlled environment. Use the concepts of this guide as an architectural basis and adapt endpoints, fields, and rules to the officially available version.

Content prepared from the analysis presented by Dericson Calari, CEO of the Agency PalmUP, focusing on tracking, automation and data intelligence applied to marketing.