> 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/datalayer-events-in-the-shopify-customer-events-pixel.md).

# dataLayer events in the Shopify customer events pixel

Shopify's Customer Events run inside a sandboxed web pixel, so which dataLayer events are present in AdPage's Customer Events Pixel?

Shopify's Customer Events run inside a sandboxed web pixel, which means the events fired on the checkout and thank-you pages do not show up in the normal dataLayer the way they do on the rest of your store. You cannot inspect them with GTM Preview mode or by typing `window.dataLayer` into the console.

This article lists every event AdPage sends from Customer Events, with a full example payload for each, so you can configure your tags without needing to debug them live.

### Event overview

| Event                          | Page                 | When it fires                                                     |
| ------------------------------ | -------------------- | ----------------------------------------------------------------- |
| `trytagging_user_data`         | Checkout & Thank you | Every page load                                                   |
| `trytagging_begin_checkout`    | Checkout             | When the checkout opens, immediately after `trytagging_user_data` |
| `trytagging_add_address_info`  | Checkout             | Every time the customer completes their full address              |
| `trytagging_add_shipping_info` | Checkout             | Every time the shipping method changes                            |
| `trytagging_add_payment_info`  | Checkout             | Every time the customer enters payment details and clicks pay     |
| `trytagging_purchase`          | Thank you            | On the payment event from Shopify                                 |

In GTM, set up a Custom Event trigger matching the exact event name for each event you want to use. Note that `trytagging_add_address_info`, `trytagging_add_shipping_info` and `trytagging_add_payment_info` can fire more than once per checkout, so add trigger conditions if you need to deduplicate.

### Shared objects

Three blocks repeat across most events. They are shown in full in every payload below, but you only need to understand them once.

**`marketing`** carries the session and click identifiers: the GA cookie values, `client_id`, `session_id`, `session_count`, the advertising click IDs (`fbp`, `fbc`, `ttclid`, `ttp`, `gclid`, `gbraid`, `wbraid`), the original referrer, UTM parameters, user agent and hostname. Identifiers that are not present in the session come through as `null` rather than being omitted, so your variables will always find the key.

**`user_data`** carries customer details. It contains two sets of fields for the same values: the current `customer_*` fields, and an older set (`id`, `email`, `firstName`, and so on). Always use the `customer_*` fields — the others are deprecated and kept only for backwards compatibility.

**Page-level fields** (`event_time`, `page_referrer`, `page_location`, `page_title`) appear on every event.

***

### Checkout page

#### `trytagging_user_data`

Fires on every page load of the checkout.

```json
{
  "event": "trytagging_user_data",
  "device": {
    "__not_supported": true
  },
  "cart": {
    "total": 2629.95
  },
  "page": {
    "title": "Checkout - Example Shop",
    "location": "https://example-shop.myshopify.com/checkouts/cn/CHECKOUT_TOKEN"
  },
  "marketing": {
    "_ga": "GA1.1.1234567890.1700000000",
    "_ga_XXXXXXXXXX": "GS1.1.1700000000.3.1.1700000600.0.0.0",
    "user_id": "00000000-0000-4000-8000-000000000000",
    "client_id": "1234567890.1700000000",
    "session_id": "1700000000",
    "session_count": "3",
    "fbp": null,
    "fbc": null,
    "ttclid": null,
    "ttp": null,
    "gclid": null,
    "gbraid": null,
    "wbraid": null,
    "referrer": "https://example-shop.myshopify.com/",
    "utm_source": null,
    "utm_medium": null,
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
    "hostname": "example-shop.myshopify.com"
  },
  "event_time": "2025-02-15T13:41:54.481Z",
  "page_referrer": "https://example-shop.myshopify.com/products/example-product",
  "page_location": "https://example-shop.myshopify.com/checkouts/cn/CHECKOUT_TOKEN",
  "page_title": "Checkout - Example Shop"
}
```

#### `trytagging_begin_checkout`

Fires as soon as the checkout opens, directly after the `trytagging_user_data` event.

```json
{
  "event": "trytagging_begin_checkout",
  "ecommerce": {
    "currency": "EUR",
    "value": 2629.95,
    "coupon": "",
    "items": [
      {
        "item_id": "40000000000001",
        "item_sku": "sku-example-1",
        "item_name": "Example Product",
        "item_brand": "Example Shop",
        "item_category": "",
        "item_variant": "Example Product",
        "price": 2629.95,
        "item_product_id": "40000000000001",
        "item_variant_id": "8000000000001",
        "item_image": "https://cdn.shopify.com/s/files/1/0000/0000/0000/products/example-product_64x64.jpg?v=1700000000",
        "google_business_vertical": "retail",
        "quantity": 1
      }
    ]
  },
  "user_data": {
    "customer_id": "",
    "customer_email": "",
    "customer_first_name": "",
    "customer_last_name": "",
    "customer_name": "undefined undefined",
    "customer_phone": "",
    "customer_zip": "",
    "customer_address": "",
    "customer_address2": "",
    "customer_country": "NL",
    "customer_state": "",
    "customer_state_code": "",
    "customer_order_count": "0",
    "customer_total_spent": 2629.95,
    "customer_city": "",
    "customer_new": false,
    "__note": "Please use customer_ fields. Other fields are deperacted",
    "id": "",
    "email": "",
    "firstName": "",
    "lastName": "",
    "phone": "",
    "zip": "",
    "address1": "",
    "address2": "",
    "country": "NL",
    "province": "",
    "provinceCode": "",
    "orderCount": "0",
    "totalSpent": 2629.95,
    "city": "",
    "new_customer": false
  },
  "marketing": {
    "_ga": "GA1.1.1234567890.1700000000",
    "_ga_XXXXXXXXXX": "GS1.1.1700000000.3.1.1700000600.0.0.0",
    "user_id": "00000000-0000-4000-8000-000000000000",
    "client_id": "1234567890.1700000000",
    "session_id": "1700000000",
    "session_count": "3",
    "fbp": null,
    "fbc": null,
    "ttclid": null,
    "ttp": null,
    "gclid": null,
    "gbraid": null,
    "wbraid": null,
    "referrer": "https://example-shop.myshopify.com/",
    "utm_source": null,
    "utm_medium": null,
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
    "hostname": "example-shop.myshopify.com"
  },
  "event_time": "2025-02-15T13:41:54.562Z",
  "page_referrer": "https://example-shop.myshopify.com/products/example-product",
  "page_location": "https://example-shop.myshopify.com/checkouts/cn/CHECKOUT_TOKEN",
  "page_title": "Checkout - Example Shop"
}
```

Note that at this point the customer fields are still empty — the visitor has not entered anything yet. `customer_name` reads `undefined undefined` because it concatenates two empty name fields.

#### `trytagging_add_address_info`

Fires every time the customer completes their full address details. This event adds a top-level `email` field and an `address` object alongside the usual blocks.

```json
{
  "event": "trytagging_add_address_info",
  "email": "customer@example.com",
  "address": {
    "address1": "Example Street 1",
    "address2": null,
    "city": "Amsterdam",
    "country": "NL",
    "countryCode": "NL",
    "firstName": "Jane",
    "lastName": "Doe",
    "phone": null,
    "province": null,
    "provinceCode": null,
    "zip": "1234 AB"
  },
  "ecommerce": {
    "currency": "EUR",
    "value": 2629.95,
    "coupon": "",
    "items": [
      {
        "item_id": "40000000000001",
        "item_sku": "sku-example-1",
        "item_name": "Example Product",
        "item_brand": "Example Shop",
        "item_category": "",
        "item_variant": "Example Product",
        "price": 2629.95,
        "item_product_id": "40000000000001",
        "item_variant_id": "8000000000001",
        "item_image": "https://cdn.shopify.com/s/files/1/0000/0000/0000/products/example-product_64x64.jpg?v=1700000000",
        "google_business_vertical": "retail",
        "quantity": 1
      }
    ]
  },
  "user_data": {
    "customer_id": "",
    "customer_email": "customer@example.com",
    "customer_first_name": "Jane",
    "customer_last_name": "Doe",
    "customer_name": "Jane Doe",
    "customer_phone": "",
    "customer_zip": "1234 AB",
    "customer_address": "Example Street 1",
    "customer_address2": "",
    "customer_country": "NL",
    "customer_state": "",
    "customer_state_code": "",
    "customer_order_count": "0",
    "customer_total_spent": 2629.95,
    "customer_city": "Amsterdam",
    "customer_new": false,
    "__note": "Please use customer_ fields. Other fields are deperacted",
    "id": "",
    "email": "customer@example.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "phone": "",
    "zip": "1234 AB",
    "address1": "Example Street 1",
    "address2": "",
    "country": "NL",
    "province": "",
    "provinceCode": "",
    "orderCount": "0",
    "totalSpent": 2629.95,
    "city": "Amsterdam",
    "new_customer": false
  },
  "marketing": {
    "_ga": "GA1.1.1234567890.1700000000",
    "_ga_XXXXXXXXXX": "GS1.1.1700000000.3.1.1700000600.0.0.0",
    "user_id": "00000000-0000-4000-8000-000000000000",
    "client_id": "1234567890.1700000000",
    "session_id": "1700000000",
    "session_count": "3",
    "fbp": null,
    "fbc": null,
    "ttclid": null,
    "ttp": null,
    "gclid": null,
    "gbraid": null,
    "wbraid": null,
    "referrer": "https://example-shop.myshopify.com/",
    "utm_source": null,
    "utm_medium": null,
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
    "hostname": "example-shop.myshopify.com"
  },
  "event_time": "2025-02-15T13:42:19.517Z",
  "page_referrer": "https://example-shop.myshopify.com/products/example-product",
  "page_location": "https://example-shop.myshopify.com/checkouts/cn/CHECKOUT_TOKEN",
  "page_title": "Checkout - Example Shop"
}
```

#### `trytagging_add_shipping_info`

Fires every time the shipping method changes. The `value` now includes shipping costs, and `ecommerce` gains a `shipping_tier` field.

```json
{
  "event": "trytagging_add_shipping_info",
  "email": "customer@example.com",
  "ecommerce": {
    "shipping_tier": "",
    "currency": "EUR",
    "value": 2634.9,
    "coupon": "",
    "items": [
      {
        "item_id": "40000000000001",
        "item_sku": "sku-example-1",
        "item_name": "Example Product",
        "item_brand": "Example Shop",
        "item_category": "",
        "item_variant": "Example Product",
        "price": 2629.95,
        "item_product_id": "40000000000001",
        "item_variant_id": "8000000000001",
        "item_image": "https://cdn.shopify.com/s/files/1/0000/0000/0000/products/example-product_64x64.jpg?v=1700000000",
        "google_business_vertical": "retail",
        "quantity": 1
      }
    ]
  },
  "user_data": {
    "customer_id": "",
    "customer_email": "customer@example.com",
    "customer_first_name": "Jane",
    "customer_last_name": "Doe",
    "customer_name": "Jane Doe",
    "customer_phone": "",
    "customer_zip": "1234 AB",
    "customer_address": "Example Street 1",
    "customer_address2": "",
    "customer_country": "NL",
    "customer_state": "",
    "customer_state_code": "",
    "customer_order_count": "0",
    "customer_total_spent": 2634.9,
    "customer_city": "Amsterdam",
    "customer_new": false,
    "__note": "Please use customer_ fields. Other fields are deperacted",
    "id": "",
    "email": "customer@example.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "phone": "",
    "zip": "1234 AB",
    "address1": "Example Street 1",
    "address2": "",
    "country": "NL",
    "province": "",
    "provinceCode": "",
    "orderCount": "0",
    "totalSpent": 2634.9,
    "city": "Amsterdam",
    "new_customer": false
  },
  "marketing": {
    "_ga": "GA1.1.1234567890.1700000000",
    "_ga_XXXXXXXXXX": "GS1.1.1700000000.3.1.1700000600.0.0.0",
    "user_id": "00000000-0000-4000-8000-000000000000",
    "client_id": "1234567890.1700000000",
    "session_id": "1700000000",
    "session_count": "3",
    "fbp": null,
    "fbc": null,
    "ttclid": null,
    "ttp": null,
    "gclid": null,
    "gbraid": null,
    "wbraid": null,
    "referrer": "https://example-shop.myshopify.com/",
    "utm_source": null,
    "utm_medium": null,
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
    "hostname": "example-shop.myshopify.com"
  },
  "event_time": "2025-02-15T13:42:20.612Z",
  "page_referrer": "https://example-shop.myshopify.com/products/example-product",
  "page_location": "https://example-shop.myshopify.com/checkouts/cn/CHECKOUT_TOKEN",
  "page_title": "Checkout - Example Shop"
}
```

#### `trytagging_add_payment_info`

Fires every time the customer enters their payment details and clicks pay. Structurally identical to the shipping event, except `ecommerce` carries `payment_type` instead of `shipping_tier`.

```json
{
  "event": "trytagging_add_payment_info",
  "email": "customer@example.com",
  "ecommerce": {
    "payment_type": "",
    "currency": "EUR",
    "value": 2634.9,
    "coupon": "",
    "items": [
      {
        "item_id": "40000000000001",
        "item_sku": "sku-example-1",
        "item_name": "Example Product",
        "item_brand": "Example Shop",
        "item_category": "",
        "item_variant": "Example Product",
        "price": 2629.95,
        "item_product_id": "40000000000001",
        "item_variant_id": "8000000000001",
        "item_image": "https://cdn.shopify.com/s/files/1/0000/0000/0000/products/example-product_64x64.jpg?v=1700000000",
        "google_business_vertical": "retail",
        "quantity": 1
      }
    ]
  },
  "user_data": {
    "customer_id": "",
    "customer_email": "customer@example.com",
    "customer_first_name": "Jane",
    "customer_last_name": "Doe",
    "customer_name": "Jane Doe",
    "customer_phone": "",
    "customer_zip": "1234 AB",
    "customer_address": "Example Street 1",
    "customer_address2": "",
    "customer_country": "NL",
    "customer_state": "",
    "customer_state_code": "",
    "customer_order_count": "0",
    "customer_total_spent": 2634.9,
    "customer_city": "Amsterdam",
    "customer_new": false,
    "__note": "Please use customer_ fields. Other fields are deperacted",
    "id": "",
    "email": "customer@example.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "phone": "",
    "zip": "1234 AB",
    "address1": "Example Street 1",
    "address2": "",
    "country": "NL",
    "province": "",
    "provinceCode": "",
    "orderCount": "0",
    "totalSpent": 2634.9,
    "city": "Amsterdam",
    "new_customer": false
  },
  "marketing": {
    "_ga": "GA1.1.1234567890.1700000000",
    "_ga_XXXXXXXXXX": "GS1.1.1700000000.3.1.1700000600.0.0.0",
    "user_id": "00000000-0000-4000-8000-000000000000",
    "client_id": "1234567890.1700000000",
    "session_id": "1700000000",
    "session_count": "3",
    "fbp": null,
    "fbc": null,
    "ttclid": null,
    "ttp": null,
    "gclid": null,
    "gbraid": null,
    "wbraid": null,
    "referrer": "https://example-shop.myshopify.com/",
    "utm_source": null,
    "utm_medium": null,
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
    "hostname": "example-shop.myshopify.com"
  },
  "event_time": "2025-02-15T13:48:11.987Z",
  "page_referrer": "https://example-shop.myshopify.com/products/example-product",
  "page_location": "https://example-shop.myshopify.com/checkouts/cn/CHECKOUT_TOKEN",
  "page_title": "Checkout - Example Shop"
}
```

***

### Thank-you page

#### `trytagging_purchase`

Fires on the payment event from Shopify. This is the event to use for your conversion tags. `ecommerce` now contains `transaction_id`, `tax` and `shipping`, and `user_data.customer_id` is populated because the order has created a customer record.

```json
{
  "event": "trytagging_purchase",
  "ecommerce": {
    "transaction_id": "6000000000001",
    "value": 2634.9,
    "tax": 0,
    "shipping": "",
    "currency": "EUR",
    "items": [
      {
        "item_id": "40000000000001",
        "item_sku": "sku-example-1",
        "item_name": "Example Product",
        "item_brand": "Example Shop",
        "item_category": "",
        "item_variant": "Default Title",
        "price": 2629.95,
        "item_product_id": "00000000000000000000000000000000",
        "item_variant_id": "8000000000001",
        "item_image": "https://cdn.shopify.com/s/files/1/0000/0000/0000/products/example-product.jpg?v=1700000000",
        "google_business_vertical": "retail",
        "quantity": 1
      }
    ]
  },
  "user_data": {
    "customer_id": "7000000000001",
    "customer_email": "customer@example.com",
    "customer_first_name": "Jane",
    "customer_last_name": "Doe",
    "customer_name": "Jane Doe",
    "customer_phone": "",
    "customer_zip": "1234 AB",
    "customer_address": "Example Street 1",
    "customer_address2": "",
    "customer_country": "NL",
    "customer_state": "",
    "customer_state_code": "",
    "customer_order_count": "0",
    "customer_total_spent": 2634.9,
    "customer_city": "Amsterdam",
    "customer_new": false,
    "__note": "Please use customer_ fields. Other fields are deperacted",
    "id": "7000000000001",
    "email": "customer@example.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "phone": "",
    "zip": "1234 AB",
    "address1": "Example Street 1",
    "address2": "",
    "country": "NL",
    "province": "",
    "provinceCode": "",
    "orderCount": "0",
    "totalSpent": 2634.9,
    "city": "Amsterdam",
    "new_customer": false
  },
  "marketing": {
    "_ga": "GA1.1.1234567890.1700000000",
    "_ga_XXXXXXXXXX": "GS1.1.1700000000.3.1.1700000900.0.0.0",
    "user_id": "00000000-0000-4000-8000-000000000000",
    "client_id": "1234567890.1700000000",
    "session_id": "1700000000",
    "session_count": "3",
    "fbp": null,
    "fbc": null,
    "ttclid": null,
    "ttp": null,
    "gclid": null,
    "gbraid": null,
    "wbraid": null,
    "referrer": "https://example-shop.myshopify.com/",
    "utm_source": null,
    "utm_medium": null,
    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
    "hostname": "example-shop.myshopify.com"
  },
  "event_time": "2025-02-15T13:48:14.579Z",
  "page_referrer": "https://example-shop.myshopify.com/",
  "page_location": "https://example-shop.myshopify.com/checkouts/cn/ORDER_TOKEN/thank_you",
  "page_title": "Thank you for your purchase! - Example Shop - Checkout"
}
```

### A few things worth knowing

**Values are placeholders.** All URLs, identifiers, names, email addresses and addresses in the examples above are anonymised. The field names and structure are exactly what you will receive.

**`item_product_id` changes format on purchase.** On the checkout events it matches `item_id`. On `trytagging_purchase` it is a hash instead. If you map this field to a tag parameter, expect two different formats and pick the one your platform needs.

**`item_variant` changes on purchase.** On checkout events it repeats the product name; on the purchase event it comes from the Shopify variant title, which is `Default Title` for single-variant products.

**Some parameters can come through empty.** `shipping_tier`, `payment_type`, `coupon` and `shipping` are empty strings in these examples. If your GA4 reports show blank values for these, that is why. Set a fallback in your variables if you need a value.

**`device` is not populated.** Shopify's sandbox does not expose device information, hence `"__not_supported": true`.


---

# 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/datalayer-events-in-the-shopify-customer-events-pixel.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.
