# Shopify webhook

URL: https://docs.ablyft.com/developers/tracking-and-events/shopify/webhook/

> Enable the Shopify integration in ABlyft and let Shopify send purchase data through a webhook.



This integration tracks the core purchase data on the server side. It measures:

* **Purchases** (as conversions)
* **Revenue** (as a value)
* **Products count** (number of items in the cart at purchase)

Good to know:

* A goal counts every time a visitor places an order. It always behaves like the counting method **Every**, whatever
  the goal setting in ABlyft says.
* The base [snippet](https://docs.ablyft.com/developers/installation/snippet/) still has to be added to `theme.liquid`. It enables the
  assignment to variations, the webhook only sends the orders.
* If a visitor starts directly at the checkout, this method does not work. Only experiments that run in the shop itself
  are tracked.
* You can combine it with the [customer event pixel](https://docs.ablyft.com/developers/tracking-and-events/shopify/customer-event/), but remove the three goals
  above from the pixel code, so nothing is counted twice.

## Step 1: Enable the integration in ABlyft

1. In ABlyft, open **Integrations** in the left menu.
2. Turn on the **Shopify** integration.
3. Open **Goals** and create these three goals:

| Goal           | Goal name                      | Goal type | Metric view    | API name         |
| -------------- | ------------------------------ | --------- | -------------- | ---------------- |
| Purchase       | `Purchase` (or any name)       | Custom    | Conversion     | `purchase`       |
| Revenue        | `Revenue` (or any name)        | Revenue   | not applicable | `revenue`        |
| Products count | `Products Count` (or any name) | Custom    | Values         | `products-count` |

The goal type, the metric view and the API name are mandatory as listed. The goal name is free.

## Step 2: Add the webhook in Shopify

1. Log in to the Shopify admin.
2. Go to **Settings → Notifications → Webhooks**.
3. Click **Create webhook** and enter:

| Field               | Value                            |
| ------------------- | -------------------------------- |
| Event               | Order creation                   |
| Format              | JSON                             |
| URL                 | `https://log.ablyft.com/shopify` |
| Webhook API version | `2025-07`                        |

4. Save the webhook.

## Check that it works

Place a test order and look at the incoming events in the **Live Log** of your project. After some days, compare the
revenue with your Shopify reports. See [Verify measurement](https://docs.ablyft.com/guides/goals-and-measurement/verify-measurement/).

- [Customer event pixel](https://docs.ablyft.com/developers/tracking-and-events/shopify/customer-event/): Track more events and product-level goals.
- [Overview](https://docs.ablyft.com/developers/tracking-and-events/shopify/): Compare both methods.

