> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/integrations-websites/shopify/optimising-webhooks-for-shopifys-express-checkout.md).

# Optimising webhooks for Shopify's Express Checkout

How to keep your marketing attribution data when customers pay through Shopify's Express Checkout

This guide explains how to keep your marketing attribution data when customers pay through Shopify's Express Checkout options such as Shop Pay, PayPal Express, Google Pay and Apple Pay. It covers what goes wrong during those checkouts, and how to fix it using Shopify order notes.

### What happens during Express Checkout

When a customer clicks an Express Checkout button, they skip your normal checkout flow. The order is completed outside the session context where your tracking runs, so the client-side purchase event never fires with the visitor's identifiers attached.

<figure><img src="https://1274044937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FA65KwL1NwewlJbtCXsXd%2Fuploads%2FSHvesfDodQTKBncBdu2C%2Fimage.png?alt=media&amp;token=cd27ab1c-c8b2-45fe-9c41-8aefa0bce1f9" alt="" width="563"><figcaption></figcaption></figure>

That means the following data does not reach your order:

* Client ID
* Session ID
* Session count
* UTM parameters
* GCLID, used for Google Ads attribution

How much this costs you depends on how many of your customers use Express Checkout. In practice we see up to 70 percent of orders arriving without any marketing attribution data at all.

### The solution: Shopify order notes

AdPage works around this by writing the marketing data into the order itself, so it travels with the order regardless of which checkout the customer used.

It works in three steps:

1. **Data capture.** The AdPage tracking code collects the marketing data during the visitor's session.
2. **Order notes.** When the order is placed, that data is stored in the `trytagging_data` note attribute on the order.
3. **Webhook delivery.** The complete marketing data reaches AdPage through the order webhook.

**Prerequisite:** order notes only work once webhooks are installed. If you have not set up webhook notifications for your Shopify store yet, do that first, see the Shopify webhook notification setup guide. GTM templates are available for WordPress, WooCommerce, Shopify and Lightspeed.

### Step 1: remove order notes from anywhere customers can see them

Order notes are now carrying technical tracking data. You do not want customers seeing raw marketing JSON on their checkout page, in their emails, or on invoices and packing slips.

This has to be done in two places. Doing only the first is the single most common mistake.

#### 1A. Adjust your theme and checkout

1. Go to **Online Store → Themes**.
2. Click **Customize** on your active theme.
3. Open **Settings** (the gear icon).
4. Go to **Checkout**.
5. Find the section for **Order notes** or **Additional information**.
6. Remove or hide the order notes field from your checkout.

#### 1B. Adjust your notification templates

This step is essential. Even with order notes removed from your theme, they can still appear on packing slips and invoices, because those are rendered from separate templates.

Go to **Settings → Notifications** and work through:

* Order confirmation (customer email)
* Shipping confirmation (customer email)
* Packing slips (PDF)
* Invoice
* Any other order-related notifications you use

Open each template and look for code along these lines:

```liquid
{% if note_attributes %}
  {% for attribute in note_attributes %}
    <p>{{ attribute.first }}: {{ attribute.last }}</p>
  {% endfor %}
{% endif %}
```

Or:

```liquid
{% if attributes %}
  {% for attribute in attributes %}
    {{ attribute.first }}: {{ attribute.last }}
  {% endfor %}
{% endif %}
```

Or simply:

```liquid
{% if note %}
  {{ note }}
{% endif %}
```

You can either delete these blocks or, better, keep them and filter out `trytagging_data` so any genuine note attributes still show:

```liquid
{% if note_attributes %}
  {% for attribute in note_attributes %}
    {% unless attribute.first == "trytagging_data" %}
      <p>{{ attribute.first }}: {{ attribute.last }}</p>
    {% endunless %}
  {% endfor %}
{% endif %}
```

**For developers:** if your theme uses custom code to render order notes on the order confirmation page or in templates, remove or filter snippets like this one as well:

```liquid
{% if order.note %}
  <div class="order-note">
    {{ order.note }}
  </div>
{% endif %}
```

Back up your templates before you edit them.

### Step 2: enable order notes in the AdPage app

1. Go to your **Online Store**.
2. Navigate to **Themes → Edit theme**.
3. Open **App embeds**.
4. Click **Tagging Head**.
5. Find the option **Use order notes for webhook delivery**.
6. Switch it on.
7. Click **Save**.

### Verifying it works

Test both halves: that the data arrives, and that customers cannot see it.

1. Place a test order.
2. Generate a packing slip: go to **Orders**, select the order, then **More actions → Print packing slips**. Check the PDF, no technical JSON should be visible anywhere on it.
3. Send yourself a test order confirmation email and check it the same way.
4. Check your invoice template too, if you use one.

If you still see `trytagging_data` or raw JSON, you have almost certainly missed a notification template in step 1B rather than done something wrong in the app.

### Best practices

**Do:**

* Use order notes only for technical tracking data once this is active
* Run a complete checkout flow after installation, not just a glance at the settings
* Strip order notes from every customer-facing surface: checkout page, order confirmation email, shipping confirmation email, invoice template, packing slip template, and any other notification template
* Test the packing slip PDF with a real order after implementation
* Keep a backup of your templates before editing them
* Re-test the setting after theme updates, since a theme update can restore the original template code

**Don't:**

* Leave order notes visible to customers
* Assume the theme change is enough and skip the notification templates
* Keep using order notes for actual customer comments once this solution is live
* Skip the verification step

### Frequently asked questions

**Can I still collect customer comments?** Not through the order notes field. Add a separate custom field for customer comments, or use Shopify's Customer Notes instead.

**What if I already use order notes for something else?** AdPage writes to a specific `trytagging_data` attribute, which does not collide with your other note attributes. Rather than deleting the whole block from your templates, filter on that one attribute name, see the code examples in step 1B.

**I still see marketing data on my packing slip. Now what?** You have probably only edited your theme, not the notification templates. Go to **Settings → Notifications** and edit the packing slip template as well. Look for code that renders `note_attributes`, `attributes` or `note`, and remove or filter it.

**Does this work for all payment methods?** Yes. It covers Shop Pay, PayPal Express, Google Pay, Apple Pay and the standard checkout.

**How much difference does this actually make?** For one Shopify client, 72 percent of orders were arriving with no UTM data at all. After enabling order notes, marketing attribution came through for orders across every checkout method, including Express Checkout.

**Can I control per template what gets shown?** Yes. Liquid lets you filter note attributes precisely, so you can show internal notes to your fulfilment team while hiding `trytagging_data` from customers.

**What happens to existing orders?** Existing orders keep their current note data. Only orders placed after you enable the setting receive the marketing tracking data.

Still stuck? Get in touch and we will look at your setup with you.

{% hint style="info" %}
Combine this with the AdPage Data Assistant to get real-time insight into your marketing performance, including orders placed through Express Checkout.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.adpage.io/integrations-websites/shopify/optimising-webhooks-for-shopifys-express-checkout.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
