Use this powerful n8n workflow to securely send hashed eCommerce Purchase or Lead events to the Meta Conversion API, ensuring privacy compliance and accurate ad attribution.
Download this n8n workflow template and start using it instantly.
• eCommerce store owners requiring precise ad performance tracking.
• Digital marketers needing a compliant way to utilize the Meta/Facebook Conversion API.
• Technical teams looking for robust, self-hosted n8n templates for advertising integrations.
• Users seeking to implement advanced server-side tracking using an n8n node structure.
Maintaining accurate marketing attribution while respecting user privacy is essential for modern eCommerce. This specialized n8n workflow addresses this challenge by providing a complete server-side tracking solution. Unlike browser-side pixels, this n8n automation ensures reliable event delivery to Meta (Facebook), bypassing ad-blockers and browser limitations. The core value of this n8n template lies in its built-in data handling: it automatically cleans, normalizes, and applies SHA256 hashing to Personally Identifiable Information (PII) like phone numbers and names before transmission, adhering to Meta’s data privacy requirements. This specific n8n workflow starts with a flexible n8n trigger, ready to ingest data from any platform via webhook, making it an indispensable tool for maximizing ad campaign effectiveness.
The conversion tracking process is initiated either by a real-time event captured by the Webhook n8n trigger (for production use) or by the Execute workflow manual n8n trigger for testing purposes.
Format data n8n node takes the raw input and maps it to the specific structure required by the Meta Conversion API, defining the eventname (e.g., Purchase) and associating the required pixelid.Normalize data n8n node cleans up PII fields. Critically, it scrubs the phone number field of non-digit characters and converts the human-readable timestamp into the Unix epoch integer format required by the Meta API.Encrypt data n8n node applies SHA256 hashing to sensitive fields (firstname, lastname, phone). This essential step ensures data compliance before external transmission.Send event to Meta n8n node uses the Facebook Graph API credential to securely post the fully structured, compliant, and hashed event payload to Meta’s servers, ensuring the conversion is accurately attributed to the ad campaign. Note that this specific n8n template includes a testeventcode for initial verification.To deploy and utilize this powerful n8n workflow, follow these steps:
Send event to Meta n8n node. This typically requires a System User Access Token with adsmanagement or similar permissions.Format data n8n node (a Code node) and replace the placeholder pixelid (1714041194725552) with your actual Meta Pixel ID.Webhook n8n trigger node. Copy the generated URL and configure your eCommerce platform (or data source) to send conversion event data to this endpoint via POST request.Execute workflow n8n trigger. Verify the data lands in your Meta Events Manager test tool using the testeventcode (TEST1337).testeventcode from the payload in the Send event to Meta n8n node to start sending live production events. Webhook (n8n trigger): The primary entry point for production data. It waits for incoming POST or GET requests containing raw conversion data.
Test data (Code n8n node): Provides standardized dummy data (names, phone, IP, FBP/FBC tokens, amounts) for quick testing of the n8n workflow logic without external input.
Format data (Code n8n node): Essential mapping n8n node. It extracts required fields from the input and structures them into the Meta Conversion API format, setting the eventname ('Purchase') and configuring the target pixelid.
Normalize data (Set n8n node): Performs data cleansing. Key configuration includes using a regular expression to clean phone numbers and a JavaScript expression (Math.floor(new Date($json.eventtime).getTime() / 1000)) to convert the timestamp format required by the API.
Encrypt data (Set n8n node): Handles privacy compliance. This n8n node applies SHA256 hashing to userdata.firstname, userdata.lastname, and userdata.phone using the hash("sha256") expression method.
Send event to Meta (Facebook Graph API n8n node): The final action. It uses a dynamic expression for the Pixel ID and posts the complete conversion event data, including the necessary custom data fields and hashed user identifiers.
Use this robust n8n workflow template to automatically generate and manage 60-day long-lived Facebook Access Tokens via the OAuth flow, essential for continuous social media automation.

Build an advanced, bilingual customer support chatbot using an n8n workflow. This automation utilizes OpenAI agents for quick responses via the Facebook Messenger n8n node, smart classification, and seamless human agent escalation for complex queries. Deploy this powerful n8n workflow today.

Build a robust Facebook Messenger AI bot using this n8n workflow. It supports text, image, and voice transcription via GPT-4, featuring tools, memory, and automated response formatting.

Automate daily family routines, meal planning, and communication reminders using this comprehensive n8n workflow. Schedule reminders for events, bedtime, and weekly planning via email and Telegram.

Use this powerful n8n workflow to automatically detect high-priority Zendesk tickets, create urgent tasks in ClickUp, and dispatch real-time priority alerts via Telegram. An essential n8n template for support teams.

Automation, Code, and Analytics for E-commerce businesses, We help businesses streamline operations using n8n, AI agents, and data science to enhance efficiency and scalability.







































