Skip to main content

Send server-side conversions to the Meta Ads API (CAPI)

Workflow preview

Workflow preview
100%
Send server-side conversions to the Meta Ads API (CAPI) preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Struggling with inaccurate Meta Ads tracking due to iOS 14+ and ad blockers? This workflow is your solution. It provides a robust, server side endpoint to reliably send conversion events directl...

Best for

  • Social Media automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.set, n8n-nodes-base.crypto, n8n-nodes-base.httprequest, n8n-nodes-base.webhook, n8n-nodes-base.respondtowebhook, n8n-nodes-base.code, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by JJ Tham.

Original n8n.io source

1.1 Workflow description

Title
Send server-side conversions to the Meta Ads API (CAPI)
Workflow name
Send server-side conversions to the Meta Ads API (CAPI)

Struggling with inaccurate Meta Ads tracking due to iOS 14+ and ad blockers? 📉 This workflow is your solution. It provides a robust, server-side endpoint to reliably send conversion events directly to the Meta Conversions API (CAPI).

By bypassing the browser, you can achieve more accurate ad attribution and optimize your campaigns with better data. This template handles all the required data normalization, hashing, and formatting, so you can set up server-side tracking in minutes.

⚙️ How it works

This workflow provides a webhook URL that you can send your conversion data to (e.g., from a web form, CRM, or backend). Once it receives the data, it:

  • Sanitizes User Data: Cleans and normalizes PII like email and phone numbers.
  • Hashes PII: Securely hashes the user data using SHA-256 to meet Meta's privacy requirements.
  • Formats the Payload: Assembles all the data, including click IDs (fbc, fbp) and user info, into the exact format required by the Meta CAPI.
  • Sends the Event: Makes a direct, server-to-server call to Meta, reliably logging your conversion event.

👥 Who’s it for?

  • Performance Marketers: Improve ad performance and ROAS with more accurate conversion data.
  • Lead Generation Businesses: Reliably track form submissions as conversions.
  • E-commerce Stores: Send purchase events from your backend to ensure nothing gets missed.
  • Developers: A ready-to-use template for implementing server-side tracking without writing custom code from scratch.

🛠️ How to set up

Setup is straightforward. You'll need your Meta Pixel ID and a CAPI Access Token.

For a complete walkthrough, check out the tutorial video for this workflow on YouTube: https://youtu.be/_fdMPIYEvFM

The basic steps are to copy the webhook URL, configure your form or backend to send the correct data payload, and add your Meta Pixel ID and Access Token to the final HTTP Request node.

👉 For a detailed, step-by-step guide, please refer to the yellow sticky note inside the workflow.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Edit Normalize PII

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 2 - Crypto - Hash Email

Type / Role
n8n-nodes-base.crypto - crypto
Config choices
Version 1

Block 3 - Crypto - Hash Phone

Type / Role
n8n-nodes-base.crypto - crypto
Config choices
Version 1

Block 4 - Set - Compute Timestamps & Map Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Crypto - First Name

Type / Role
n8n-nodes-base.crypto - crypto
Config choices
Version 1

Block 6 - Crypto - Last Name

Type / Role
n8n-nodes-base.crypto - crypto
Config choices
Version 1

Block 7 - Sending Events To Facebook Pixel

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 9 - Respond to Webhook

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.4

Block 10 - Preparing for HTTP Request Payload

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Send server-side conversions to the Meta Ads API (CAPI)
Complexity intermediate
Nodes 14
Categories Social Media
Author JJ Tham
Published 21 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11089/11089.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Send server-side conversions to the Meta Ads API (CAPI) do?

Struggling with inaccurate Meta Ads tracking due to iOS 14+ and ad blockers? This workflow is your solution. It provides a robust, server side endpoint to reliably send conversion events directl...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Social Media use case.