Conversion Tracking
16 minute read

How to Set Up Ad Platform Conversion APIs: A Step-by-Step Guide for Accurate Tracking

Written by

Matt Pattoli

Founder at Cometly

Follow On YouTube

Published on
May 7, 2026

Browser-based tracking is losing ground fast. Between cookie restrictions, iOS privacy updates, and the growing adoption of ad blockers, the pixel data feeding your ad platform algorithms is increasingly incomplete. The result is predictable and painful: your campaigns optimize on partial information, your reported conversions drift further from reality, and your cost per acquisition climbs without a clear explanation.

Conversion APIs solve this problem at the source. Instead of relying on a browser pixel that can be blocked, delayed, or stripped of identifiers, server-side events travel a more reliable path directly from your server to ad platforms like Meta, Google, and TikTok. Ad platform algorithms get the complete, high-quality data they need to find your best customers and optimize toward real outcomes.

But setting up conversion APIs across multiple platforms can feel overwhelming. Each platform has its own developer portal, authentication flow, event structure, and testing tools. Miss a step and your data either never arrives or arrives malformed, which can actually hurt campaign performance more than having no server-side tracking at all.

This guide walks you through the entire process, from auditing your current tracking to validating live event data. Whether you are configuring Meta's Conversions API, Google Ads' server-side tagging, or TikTok's Events API, you will follow the same core workflow. And if you want to skip the manual complexity entirely, we will also show how tools like Cometly can handle conversion syncing across all your ad platforms from a single setup, so your team spends less time wrestling with developer portals and more time acting on clean data.

Step 1: Audit Your Current Tracking and Identify the Gaps

Before you write a single line of API code, you need to understand exactly where your current tracking is breaking down. Jumping straight into implementation without this audit is like patching a roof without knowing where the leaks are.

Start by reviewing your existing pixel or tag-based tracking setup across every ad platform you run. Log into Meta Events Manager, Google Tag Manager, and TikTok Ads Manager and confirm which events are actively firing. Check the event count, the event quality score, and when each event was last received. You are looking for events that fire inconsistently, events with low match quality scores, or events that simply stopped registering.

Next, compare your ad platform conversion data against your CRM or backend records for the same time period. If your Meta Events Manager shows significantly fewer purchases than your Shopify dashboard or CRM, that gap represents the conversions your pixel is missing. When ad platforms reporting different conversion numbers becomes a recurring pattern, it is a clear sign that browser-based tracking is no longer sufficient. Over time, that missing data degrades your audience targeting and pushes your cost per acquisition higher.

Common signs your pixel data is degraded: You notice mismatched conversion counts between your ad platform and your backend. Your CPAs are rising without any obvious change in creative or targeting. Your lookalike audiences feel less effective than they used to. Your retargeting pools are shrinking even though traffic levels are stable.

Once you have a clear picture of where the gaps are, document which conversion events matter most to your business. For most teams, this list includes purchases, qualified leads, demo requests, free trial signups, and add-to-cart events. Prioritize these for your conversion API setup. You do not need to send every possible event on day one. Start with the high-value conversions that most directly inform your bidding strategies, then expand from there.

This audit also gives you a baseline. Once your conversion API is live, you can return to these numbers and measure exactly how much your event match quality and reported conversion volume improved.

Step 2: Gather Platform Credentials and Configure Access

Each ad platform requires its own authentication setup before you can send a single server-side event. Getting this right upfront saves you hours of troubleshooting later. Here is what you need for each platform.

Meta Conversions API: Navigate to Meta Events Manager and select the pixel you want to connect. Under Settings, you will find the option to generate a Conversions API access token. Copy this token and store it immediately since it will not be shown again in full. You will also need your Pixel ID, which appears at the top of the Events Manager dashboard. For a deeper walkthrough of this specific platform, our Facebook conversion API setup guide covers every detail. Make sure the account generating the token has admin-level access to the Business Manager and the specific pixel. Without the right permissions, your events will be rejected silently.

Google Ads server-side tracking: Google's server-side implementation runs through Google Tag Manager. You will need to create a server-side GTM container separate from your web container, then provision a tagging server (either through Google's managed hosting or your own cloud infrastructure). Once your tagging server is running, connect your Google Ads conversion actions to it using the Google Ads conversion linker tag. You will also need to enable enhanced conversions in your Google Ads account under Goals, which allows you to pass hashed first-party data alongside your conversion events.

TikTok Events API: In TikTok Ads Manager, navigate to Assets, then Events, and select your web pixel. Under the pixel settings, you will find the option to generate an Events API access token. Link this token to your existing pixel so that server-side events can be deduplicated against browser pixel events. Note your pixel code ID as well, since this is required in every API payload you send.

Once you have collected credentials from each platform, organize them in a secure internal document. Managing credentials across multiple platforms is one of the key conversion API setup challenges that teams underestimate. Include the API token, pixel or dataset ID, the API endpoint URL for each platform, and the account or business ID associated with each token. Share this document only with team members who need direct access, and treat API tokens with the same security discipline you would apply to passwords. Rotate tokens periodically and immediately if a team member with access leaves the organization.

This credential management step sounds administrative, but it is genuinely one of the most common points of failure in multi-platform conversion API setups. Teams that skip the documentation phase often find themselves re-generating tokens and re-configuring access weeks later when something breaks.

Step 3: Map Your Conversion Events and Define the Data Payload

Here is where precision matters most. The quality of your conversion API data is directly determined by how well you define your events and structure your payloads before you start sending anything.

Start by standardizing your event names across platforms. Meta, Google, and TikTok each have their own standard event vocabularies. Meta uses names like Purchase, Lead, and CompleteRegistration. Google uses conversion action names you define in the platform. TikTok follows a similar standard event list. Where possible, align your internal event taxonomy with each platform's standard names so that the data feeds directly into their native optimization models without translation friction.

For each event, define exactly which parameters you will include in the payload. At minimum, every event should carry the event name, event time (as a Unix timestamp), and at least one user identifier. User identifiers are what allow the platform to match your server event to an actual account, which is what drives your Event Match Quality score.

User identifiers to include: Hashed email address, hashed phone number, IP address, user agent string, and the platform-specific click ID (fbclid for Meta, gclid for Google, ttclid for TikTok). The more identifiers you pass, the higher your match rate will be. For purchase events, also include the event value, currency, and any relevant content IDs or product identifiers.

Hashing is not optional. Meta, TikTok, and Google all require that personally identifiable information like email addresses and phone numbers be hashed using SHA-256 before transmission. Sending unhashed PII will cause your events to be rejected or flagged. Most server-side implementations handle this automatically, but if you are building a custom integration, make sure hashing is applied consistently before any data leaves your server.

Deduplication is the other critical element to define at this stage. When you run both a browser pixel and a Conversions API simultaneously (which is the recommended approach), both will often fire for the same conversion event. Without deduplication, the platform counts it twice, which inflates your reported conversions and corrupts your optimization data. Our guide on duplicated conversion tracking across platforms explains this problem in depth. The solution is to assign a unique event ID to every conversion event and pass that same ID in both the pixel event and the API event. The platform uses this ID to recognize duplicates and count the conversion only once.

Step 4: Build and Send Your First Server-Side Events

With your credentials secured and your event schema defined, you are ready to start sending data. This step has two paths depending on your technical resources and how many platforms you are managing simultaneously.

Direct API integration: This approach involves writing custom server-side code that formats your conversion data as a JSON payload and sends it to each platform's API endpoint via HTTPS. For Meta, you send a POST request to the Graph API endpoint using your pixel ID and access token. A basic purchase event payload includes the event name, event time, user data object (with hashed identifiers), and custom data object (with value and currency). The request must be authenticated with your access token in the URL or request header.

For Google, server-side events flow through your GTM server container. You configure a client tag to receive events from your website, transform them into the format Google expects, and route them to your Google Ads conversion action. For TikTok, the structure is similar to Meta: a POST request to the Events API endpoint with your access token, pixel code, and a structured event object.

The direct integration approach gives you maximum control, but it requires developer time for each platform, ongoing maintenance as platforms update their API schemas, and separate testing workflows for each integration. If you are evaluating whether to build or buy, comparing conversion API tools can help you weigh the tradeoffs.

Using a middleware platform: This is where tools like Cometly's Conversion Sync become genuinely valuable. Rather than building and maintaining separate integrations for Meta, Google, TikTok, and any other platforms you run, Cometly handles the connection from a single integration point. It automatically formats conversion events to each platform's specifications, applies the correct hashing, attaches click IDs and user identifiers, and routes the enriched data to each platform simultaneously.

More importantly, Cometly enriches the conversion data itself. Because it tracks the full customer journey from ad click through CRM events, the conversion data it sends back to each platform includes the attribution context that makes the signal genuinely useful for optimization. Ad platform algorithms receive not just the fact that a conversion happened, but a richer picture of the customer who converted.

Common pitfalls to avoid at this stage: Incorrect timestamp formats are a frequent source of rejected events. All platforms expect Unix timestamps in seconds, not milliseconds. Missing required fields like event name or event time will cause silent failures. Sending test events in production mode will pollute your live data. And forgetting to pass click IDs means your events arrive at the platform with no way to connect them back to specific ad campaigns, which dramatically reduces their optimization value.

Step 5: Test, Validate, and Troubleshoot Your Event Data

Never assume your events are arriving correctly just because your code ran without errors. Each platform provides testing tools specifically designed to confirm that events are received, parsed correctly, and matched to real accounts. Use all of them before declaring your setup complete.

Meta Events Manager Test Events: In Events Manager, navigate to the Test Events tab and enter your test event code. Fire a conversion event from your server using this test code in the payload, and you will see the event appear in real time with full parameter details. Confirm that the event name matches what you defined, that user data fields are present (even in hashed form), and that the Event Match Quality score appears. A score of seven or above on Meta's ten-point scale indicates solid matching. Scores below five suggest you are missing key user identifiers.

Google Tag Manager Preview and Ads Diagnostics: Use GTM's Preview mode to step through your server-side container and confirm that tags fire in the correct sequence and pass the expected variables. Then check Google Ads under Goals and Conversions to review your conversion action status. Google will flag conversion actions that have not received recent data or that show matching issues. The enhanced conversions diagnostic tool will also tell you whether your hashed first-party data is being received and processed correctly.

TikTok Events API testing tool: TikTok Ads Manager includes an event testing interface under the pixel settings. Send a test event and verify that it appears with the correct event name, timestamp, and parameter values. TikTok will also show you whether the event was successfully matched to a TikTok account, which is the server-side equivalent of their pixel match quality indicator.

When things go wrong: If events show as received but not matched, the most common cause is missing or incorrectly formatted user identifiers. Double-check that your email hashing is lowercase before SHA-256 encoding, that phone numbers include country codes, and that click IDs are being captured from URL parameters and passed through correctly. If deduplication is failing and you are seeing double-counted conversions, verify that your event ID logic is generating truly unique IDs and that the same ID is being passed in both the pixel and API events. For a complete walkthrough of the testing and validation process, our setup conversion API tutorial covers each platform's diagnostic tools step by step. If event counts still do not align with your backend data after several days, compare timestamps carefully since attribution windows and processing delays can create apparent discrepancies that resolve themselves within 24 to 48 hours.

Step 6: Optimize Event Match Quality and Feed Better Data to Algorithms

Getting your conversion API live is the foundation. Optimizing it is where the real performance gains come from. The quality of the data you send matters as much as the fact that you are sending it at all.

Event Match Quality is Meta's explicit scoring system for rating how well your server events can be matched to Facebook accounts. Higher match rates mean Meta can attribute more conversions to the right campaigns, which improves the optimization signals feeding your bid strategies and audience targeting. Google uses a conceptually similar approach with enhanced conversions, where passing richer first-party data improves conversion matching across its network. TikTok follows the same principle.

Tactics to improve match quality across all platforms:

Send multiple user identifiers simultaneously. Do not rely on email alone. Pass email, phone number, IP address, user agent, and the platform-specific click ID together. Each additional identifier increases the probability of a successful match.

Capture and pass click IDs reliably. The fbclid, gclid, and ttclid parameters appended to your ad URLs are the most direct link between a conversion event and a specific ad click. If these parameters are being dropped somewhere in your funnel (often by URL redirects, landing page builders, or CRM systems that strip UTM parameters), your match quality will suffer significantly. Audit your full click path to confirm these IDs survive from ad click to conversion event. Learning how to feed conversion data back to ad platforms with complete identifiers is essential for maximizing algorithm performance.

Leverage Cometly's full-journey enrichment. Cometly tracks the entire customer journey from the initial ad click through every touchpoint to the final conversion, including CRM events that happen offline or days after the initial click. When it syncs that data back to each ad platform, it sends enriched conversion events that carry attribution context the platforms cannot generate on their own. This gives ad algorithms a more complete picture of which campaigns are driving real revenue, not just surface-level clicks.

Set up ongoing monitoring rather than a one-time check. Conversion API setups degrade over time. Platforms update their API schemas, your website changes, CRM integrations break, and new conversion events get added without being included in your server-side setup. Build a weekly habit of comparing your API-reported conversions against your CRM or backend database. Teams managing ads across multiple channels should review our guide on accurate cross-platform conversion tracking to ensure their monitoring covers every integration point. Any growing discrepancy is an early warning sign that something in your pipeline needs attention before it affects campaign performance.

Your Conversion API Setup Checklist

Here is a quick-reference summary of everything covered in this guide, organized as a checklist you can use to track your progress and return to as your setup evolves.

1. Audit your current tracking. Compare ad platform conversion data against your CRM. Document the gaps, identify your highest-priority conversion events, and establish a baseline to measure improvement against.

2. Gather credentials and configure access. Generate API tokens for Meta, Google, and TikTok. Confirm admin-level permissions. Store all credentials, pixel IDs, and endpoint URLs in a secure team document.

3. Map your events and define payloads. Standardize event names across platforms. Define which parameters each event will carry. Implement SHA-256 hashing for all PII. Set up unique event ID logic for deduplication.

4. Build and send server-side events. Choose between direct API integration or a middleware platform like Cometly's Conversion Sync. Send your first test events and confirm they reach each platform without errors.

5. Test and validate delivery. Use Meta's Test Events tool, Google's conversion diagnostics, and TikTok's event testing interface. Confirm Event Match Quality scores, event receipt, and correct parameter formatting.

6. Optimize match quality and monitor ongoing. Pass multiple user identifiers, capture and preserve click IDs across your funnel, and set up weekly comparisons between API-reported conversions and your backend source of truth.

Conversion API setup is not a one-time task. Platforms update their requirements, your conversion events evolve, and the data landscape keeps shifting. Treat this as an ongoing process that gets reviewed and refined regularly, not a box you check once and forget.

For teams managing multiple ad platforms simultaneously, the complexity of maintaining separate integrations for Meta, Google, TikTok, and others adds up quickly. Cometly's Conversion Sync feature reduces that complexity by handling event formatting, deduplication, and delivery from a single integration point, while also enriching your conversion data with full-journey attribution that makes every signal more valuable to the algorithms optimizing your spend.

Ready to see how server-side conversion syncing works in practice? Get your free demo and discover how Cometly can help you capture every touchpoint, feed better data to your ad platforms, and make smarter decisions about where to scale your budget.