Quick overview
This workflow reads backend conversion events, normalizes and SHA-256-hashes required identifiers, and then sends each conversion to Meta Conversions API, Google Ads Enhanced Conversions, or both using HTTP requests with environment-based access tokens.
How it works
- Runs manually to start the conversion upload.
- Sets the Meta Pixel ID, Meta/Google API versions, and Google Ads customer and conversion action IDs used to build requests.
- Loads backend conversion records (example rows) that include a destination flag (meta, google, or both) plus identifiers and conversion value data.
- Normalizes the identifier fields and hashes the required PII fields (email, phone, name, city/state/zip/country) with SHA-256.
- Regroups hashed identifiers with the original non-hashed fields (such as external_id, fbc/fbp, IP address, and user agent) into a per-conversion payload structure.
- Routes each conversion to Meta and/or Google based on the destination flag.
- Sends conversions to the Meta Conversions API and uploads conversions to the Google Ads API using authenticated HTTP requests.
Setup
- Replace the example conversion source with your own data source (for example Supabase, Postgres, or Google Sheets) and ensure each record includes destination, identifiers, event details, and value/currency.
- Update the configuration values for META_PIXEL_ID, GOOGLE_ADS_CUSTOMER_ID, GOOGLE_ADS_CONVERSION_ACTION, and any API version or test event settings.
- Set the required environment variables in n8n: META_ACCESS_TOKEN, GOOGLE_ADS_ACCESS_TOKEN, and GOOGLE_ADS_DEVELOPER_TOKEN.
- If needed, set GOOGLE_ADS_LOGIN_CUSTOMER_ID for manager-account access, and set META_TEST_EVENT_CODE to test Meta events before going live.
Customization
- Adjust the trigger and source data as per your CRM/Event source