How to Set Up Webhooks via Shopify Flow  (Step-by-Step Guide)

Tracking events in Shopify is not always straightforward.

Some of the most important events—like subscription renewals, backend order updates, or offline purchases—don’t happen directly on the website. As a result, they are often missing from GA4, Google Ads, or Meta reporting.

This is where webhooks + Shopify Flow + server-side GTM become powerful.

With Shopify Flow, you can automate sending event data directly from Shopify to your server-side Google Tag Manager (sGTM) setup — without writing code.

In this guide, you’ll learn how to set up webhooks via Shopify Flow step by step, and how to use them for accurate server-side tracking.

What is Shopify Flow and why use it for webhooks?

Shopify Flow is an automation tool built for Shopify stores. It allows you to create workflows based on events like:

  • order created
  • order paid
  • product updated
  • customer created

Instead of manually handling these events, Flow lets you trigger actions automatically.

One of the most powerful actions available is:

👉 Send HTTP request (webhook)

This means you can send Shopify data directly to your server tracking setup.

Why use webhooks with Shopify Flow?

Using webhooks with Shopify Flow solves a major problem:

👉 Tracking events that don’t happen in the browser

For example:

  • subscription renewals
  • backend order updates
  • offline purchases
  • refunds and cancellations

These events never trigger browser tracking.

So if you rely only on client-side tracking, you will miss them.

With webhooks, you can send these events directly to:

  • Google Tag Manager (server container)
  • Google Analytics 4
  • Meta Ads Manager

How the setup works (simple flow)

Before jumping into steps, understand the flow:

👉 Shopify event → Shopify Flow → Webhook → Server GTM → Platforms

This ensures events are captured even if they never touch the browser.

Step-by-step: Setting up webhook in Shopify Flow

Now let’s walk through the full setup.

Step 1: Create a new Flow

Go to your Shopify admin → open Shopify Flow → create a new workflow.

Start by selecting a trigger.

Common triggers:

  • Order Paid (most common)
  • Order Created
  • Order Fulfilled

👉 Choose based on when you want to track the event.

Step 2: Add a “Wait” action (important)

In many cases, Shopify apps (especially subscription apps) add tags or update order data after the event is triggered.

If you send the webhook immediately, you may miss this data.

So add a:

👉 Wait action (e.g., 2–5 minutes)

This ensures all necessary data is available before sending the webhook.

Step 3: Add a condition (filter events)

Not all orders should trigger the webhook.

For example, you may want to track only:

  • subscription orders
  • recurring payments
  • specific product types

To do this, add a condition step.

Example logic:

👉 Check if order tag contains something like:

subscription_recurring_order

If the condition is TRUE → continue
If FALSE → stop the workflow

This prevents sending unnecessary data.

Step 4: Send webhook (HTTP request)

Now comes the main step.

Add action:

👉 Send HTTP request

This is your webhook.

Configure webhook settings:

Method:
POST

URL:
Your server GTM endpoint (example):

https://sgtm.yoursite.com/data

👉 You can customize the path based on your Data Client setup.

Headers:

Content-Type: application/json

Payload (event data)

Now define the event structure.

Example:

{

  “event”: “purchase”,

  “user_id”: “{{order.customer.id}}”,

  “ecommerce”: {

    “transaction_id”: “{{order.name}}”,

    “value”: {{order.totalPriceSet.presentmentMoney.amount}},

    “currency”: “{{order.presentmentCurrencyCode}}”,

    “items”: []

  }

}

You can extend this with:

  • product details
  • tax
  • shipping
  • coupon
  • SKU

👉 Shopify Flow allows you to dynamically pull this data using variables.

Step 5: Process webhook in server GTM

Once the webhook is sent, your server GTM container receives it.

Inside sGTM:

  • Use a Data Client (or custom client)
  • Parse the incoming request
  • Convert it into event data
  • Send it to platforms like GA4 or Meta

This is where you can:

  • validate data
  • remove unnecessary fields
  • apply consent rules
  • enrich events

Step 6: Debug your webhook setup

Testing is critical.

Since this is server-side, debugging works differently.

You can:

  • use preview mode in server GTM
  • add header:

x-gtm-server-preview

This allows webhook requests to appear in preview mode.

Step 7: Validate event in GA4 / Ads

After triggering a test event:

Check:

  • Is the event received?
  • Are values correct?
  • Are items structured properly?
  • Is duplication handled?

👉 Always verify before going live.

Common mistakes to avoid

From real-world setups, these are the most common issues:

❌ Sending webhook too early

→ Fix: add “Wait” step

❌ No filtering condition

→ Sends unnecessary data

❌ Wrong payload structure

→ Events won’t work in GA4

❌ Missing debugging

→ Hard to troubleshoot later

❌ No server-side validation

→ Data quality issues

Why this setup is powerful

Using Shopify Flow + webhooks gives you:

More accurate tracking

Capture events that never happen in the browser

Better attribution

Send complete purchase data to ad platforms

Automation

No manual syncing or exports

Flexibility

Customize payload per platform

Real use cases

You can use this setup for:

  • subscription renewals
  • offline orders
  • refunds
  • cancellations
  • CRM updates
  • backend-triggered events

👉 Basically, anything that Shopify knows — you can send.

Final thoughts

If you’re relying only on browser tracking in Shopify, you’re likely missing important data.

Webhooks via Shopify Flow allow you to:

  • capture backend events
  • send them directly to server GTM
  • improve tracking accuracy
  • reduce data loss