n8n

How to Sync Shopify and Mautic Marketing Consent?

Keep email marketing consent in sync between Shopify customers and Mautic segments. Built for ecommerce teams that send campaigns and need accurate consent in both systems. You get clean lists and quick updates without manual edits.

Two event paths keep data aligned. When Shopify updates a customer, the workflow finds or creates the contact in Mautic, then adds or removes the person from a confirmed segment based on the marketing consent flags. When Mautic changes a contact’s email subscription, a secure webhook hits n8n, the request is checked with an HMAC signature, and the flow looks up the Shopify customer by email through the Admin GraphQL API. A mutation then sets the email marketing consent to subscribed or unsubscribed. The logic uses If nodes for decisions, Mautic OAuth2 for contacts and segments, and Shopify header auth for GraphQL.

Setup needs a Shopify Admin API token, your store subdomain, a Mautic instance with API enabled, a segment ID, and a shared secret for the webhook. Expect faster list updates, fewer consent errors, and better compliance. It works well for post purchase opt in, GDPR requests, and support driven opt outs. Follow the steps below to configure and test the sync.

What are the key features?

  • Shopify Trigger listens to customers update events and starts the sync
  • Mautic Webhook path receives subscription change events from Mautic
  • HMAC signature check with the Crypto node validates webhook requests
  • GraphQL query finds the Shopify customer by email from the webhook payload
  • GraphQL mutation updates email marketing consent to subscribed or unsubscribed
  • Mautic nodes add or remove the contact from a confirmed segment
  • Contact lookup and auto create in Mautic keep lists complete
  • If nodes control branching for consent status and contact existence

What are the benefits?

  • Reduce manual consent updates from hours per week to minutes with real time sync
  • Improve data accuracy by up to 95 percent by removing manual edits
  • Connect Shopify and Mautic so both systems show the same consent state
  • Handle high volumes of customer changes without extra staff
  • Lower compliance risk by updating consent as soon as it changes

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Shopify and Mautic. See the Tools Required section above for links to create accounts with these services.
  3. In n8n, open the Shopify Trigger node. In the Credential to connect with dropdown, click Create new credential. Choose Shopify Access Token. Enter your shop domain and Admin API access token, then save.
  4. Open each GraphQL node. In Credential to connect with choose Create new credential and select HTTP Header Auth. Add header X-Shopify-Access-Token with your Admin API token. Name the credential clearly such as Shopify GraphQL Token and save.
  5. Open a Mautic node like Add to confirmed segment. In the credential dropdown select Create new credential and choose Mautic OAuth2. Enter your Mautic base URL and follow the on screen steps to authorize. Reuse the same credential on all Mautic nodes.
  6. Double click the Set Shopify Subdomain node and enter your store subdomain only for example mystore not the full URL. Save.
  7. Update the Mautic segment ID on both Add to confirmed segment and Remove from confirmed segment so both point to the same confirmed segment in your Mautic account.
  8. Copy the Production URL from the Webhook node in n8n. In your Mautic dashboard create a webhook for contact subscription change events and paste the URL. Set a shared secret and save.
  9. Open the Crypto node in n8n and set the same shared secret you used in Mautic. Keep the HMAC SHA256 type and base64 encoding to match the signature. Ensure the If node compares the computed hash to the header sent by Mautic.
  10. Test the Shopify to Mautic path: change a customer’s email marketing consent in Shopify. In n8n check Executions. Confirm the contact was found or created in Mautic and the segment membership updated.
  11. Test the Mautic to Shopify path: in Mautic toggle a contact’s email subscription. Verify in Shopify that the customer’s email marketing consent changed. If you get errors, check that your Shopify Admin token has read and write customers permissions.
  12. Turn on the workflow in n8n. Monitor a few live events. If contacts are not found by email, confirm the email field exists in the payload and the GraphQL customer search query matches your data format.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Mautic

Sign up

Self-hosted (open source): $0 (API available).

Shopify

Sign up

Starter plan: $5 / mo

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.