Events tracking and user data tracking allow you to send behavioral data from your Shopify store to MoEngage. After you track these events, you can use them to build segments, trigger campaigns, and personalize communication based on user actions on your store.
Tracked Events
MoEngage tracks the following events when you enable them on your Shopify app during integration.
| Event Type | Event Name | Description |
|---|---|---|
| Product Event | Product Viewed | MoEngage tracks this event when a user views a product page. Use this to send back-in-stock alerts or personalized product recommendations. Note: This event is triggered only on the default Shopify product page template. Users who store that use custom product page templates require additional implementation. For more information, contact the MoEngage Support team |
| Product Event | Product Searched | MoEngage tracks this event when a user searches for a product. Use this to personalize recommendations based on search intent. |
| Cart Event | Shopify - Add To Cart / Shopify - Update Cart | MoEngage tracks this event when a user adds a product to the cart or updates the cart. Use this to trigger the cart-abandonment campaigns. |
| Cart Event | Removed from Cart | MoEngage tracks this event when a user removes a product from the cart. |
| User Login Event | Customer Registered | MoEngage tracks this event when a customer registers with the Shopify store. Use this for welcome messages and onboarding flows. |
| User Login Event | Customer Logged In | MoEngage tracks this event when a customer logs in to the store. |
| User Login Event | Customer Logged Out | MoEngage tracks this event when a customer logs out of the store. |
| Checkout Event | Shopify - Checkout Started | MoEngage tracks this event when the customer initiates checkout. |
| Checkout Event | Shopify - Checkout Updated | MoEngage tracks this event when the customer updates their cart during checkout. |
| Order Event | Shopify - Order Placed | MoEngage tracks this event when a customer completes a purchase. Use this for order confirmation messages, loyalty-program nudges, or subscription prompts. |
| Order Event | Shopify - Order Fulfilled | MoEngage tracks this event when you fulfill an order, and it is ready to ship. |
| Order Event | Shopify - Order Partially Fulfilled | MoEngage tracks this event when you fulfill some, but not all, items in an order. |
| Order Event | Shopify - Order Cancelled | MoEngage tracks this event when you cancel an order. |
| Order Event | Shopify - Refund Created | MoEngage tracks this event when you create a refund, either due to a cancellation or a complaint. Use this to send personalized communication and reduce churn. |
| warning |
Note Do not use "moe_" as a prefix when you name events, event attributes, or user attributes. It is a reserved system prefix. Using it might result in periodic blacklisting without prior communication. |
Types of Events
Two sources generate events in the MoEngage Shopify integration:
- Webhook: Shopify generates these events and sends them directly to MoEngage via the Shopify webhook system. These represent server-side signals that the Shopify backend triggers, for example, when a user places an order or starts a checkout.
- Web SDK: The MoEngage JavaScript SDK running in the browser generates these events based on user behavior on your store frontend — for example, a product page view or a search action.
Both sources capture some events, such as Add to Cart and Checkout Started. This means that two separate event records can appear in MoEngage for the same user action, each with a different name and different attributes.
Recommended Event Version for Campaigns and Segmentation
| info |
For any event that both Webhook and the Web SDK track, use the Webhook version when building segments or triggering campaigns. MoEngage receives webhook events directly from the Shopify backend; they are the more reliable signal for campaign logic. Web SDK events are useful for triggering on-site messages that must fire in real time within the browser session. If you use both versions of the same event in a single campaign or journey, you will cause conflicts and prevent a single consistent event-triggered flow from running. |
Event Attribute Requirements
Product URL and Image URL in Webhook Events
Webhook events do not include the product URL or image URL in their payloads. These attributes are present only when you capture the event by using the Web SDK.
To obtain these attributes: If you sync your product catalog to MoEngage, you can pull the product URL and image URL from the catalog at send time by using Product set-based personalization. For more information, refer to the User Actions Model.
Shopify Customer Metafields
MoEngage does not sync Shopify customer metafields, custom data fields attached to the Shopify customer object, to MoEngage user profiles by default. MoEngage also does not include them in event attributes.
To pass this data in a custom manner, refer to the Track Custom User Attributes section below.
Track Custom Events via Shopify Liquid
If you must track events beyond the MoEngage default set, for example, a wishlist action or a custom button click, you can add them using the MoEngage Web SDK in your Shopify theme's Liquid files.
| library_add_check |
Before You Start This procedure requires editing your Shopify theme files, which requires developer access. Check with your web team before you make changes. |
Step 1: Identify the Correct Liquid File to Edit
Shopify themes use Liquid template files to render pages. To find the right file, perform the following steps:
- Log in to your Shopify Admin.
- Go to Online Store > Themes.
- Locate the theme you want to edit and click the Actions (three dots) button.
- Select Edit code from the drop-down menu.
- Browse the
sections/folder.
The file you edit depends on where the event should trigger:
-
Product page actions: Edit
sections/product-template.liquidorsections/main-product.liquid. - Collection page actions: Edit the relevant collection section file.
-
All pages: Edit
layout/theme.liquid. Use this file sparingly.
Step 2: Add the Track-Event Call
In the Liquid file, locate the HTML element the user interacts with. Add a JavaScript call to the MoEngage track_event method.
Moengage.track_event("EVENT_NAME");Moengage.track_event("EVENT_NAME", {
"attribute_1": "value_1",
"attribute_2": 2,
"attribute_3": 3.4
});<button id="wishlist-btn" onclick="trackWishlistEvent()">Add to Wishlist</button>
<script>
function trackWishlistEvent() {
Moengage.track_event("Wishlist Added", {
"Product ID": "{{ product.id }}",
"Product Title": "{{ product.title }}",
"Price": {{ product.selected_or_first_available_variant.price | divided_by: 100.0 }},
"Product URL": "https://{{ shop.domain }}{{ product.url }}"
});
}
</script>Step 3: Validate That the Event Fires
To validate that the event fires correctly, refer to the Validate Integration documentation.
Track Custom User Attributes
You can pass custom attributes (such as metafields) to MoEngage profiles by using the following workarounds.
Liquid-Based Method for Public Metafields
If you enable storefront access for the metafield, it can be read directly in Shopify Liquid. To find the correct file and add the code, perform the following steps:
- Log in to your Shopify Admin.
- Go to Online Store > Themes.
- Locate the theme you want to edit and click the Actions (three dots) button.
- Select Edit code from the drop-down menu.
- Open
layout/theme.liquid. - Inside the
<body>tag, after you initialize the MoEngage SDK, add the following code:
{% if customer %}
<script>
Moengage.add_user_attribute("Loyalty Tier", "{{ customer.metafields.loyalty.tier.value }}");
Moengage.add_user_attribute("Custom Attribute", "{{ customer.metafields.custom.attribute_name.value }}");
</script>
{% endif %}Replace loyalty and tier with the actual namespace and key of your metafield. The {% if customer %} guard ensures the code only runs when a customer is logged in.
Server-Side Sync for App-Owned Metafields
If a third-party app created the metafield, storefront access is typically set to None. In this case, you must perform a server-side integration:
- Subscribe to the
customers/updateShopify webhook. - In your webhook handler, use the Shopify Admin API to read the customer’s metafield values.
- Call the MoEngage Data API to update the corresponding user attributes on the customer’s profile.
Sample Event Payloads
The payload samples below show the attributes available for reference when building segments and personalizing event data. Full payload samples for each event are shown below.
Sample Payloads for Webhook Events
{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Product Title": "Sample Product",
"Updated At": "17th July 2023, 03:26:15 pm",
"Variation ID": "123456",
"Currency": "USD",
"cart_token": "c1-fcdd3207bee3eef9f98abefaf2ca...",
"Product ID": "845236547",
"Price": 555.99,
"Source": "Shopify",
"Vendor Name": "845236547",
"Created At": "17th July 2023, 03:25:55 pm",
"Quantity": 2
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Product Title": "Sample Product",
"Updated At": "17th July 2023, 03:26:15 pm",
"Variation ID": "123456",
"Currency": "USD",
"Product ID": "845236547",
"Price": 555.99,
"Source": "Shopify",
"Vendor Name": "845236547",
"Created At": "17th July 2023, 03:25:55 pm",
"Quantity": 2
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Product Title": "Sample Product",
"Updated At": "17th July 2023, 03:26:15 pm",
"ID": "3cce6aeedf786679ac03e043729fd...",
"Variation ID": "0:123456",
"Currency": "USD",
"Checkout ID": "3cce6aeedf786679ac03e043729fd...",
"Source Name": "web",
"cart_token": "c1-fcdd3207bee3eef9f98abefaf2ca...",
"Checkout URL": "https://store.myshopify.com/products/snowboard",
"Shopify Customer Id": 36838667059499,
"Total Price": 327,
"Price": 0:300.00,
"Subtotal Price": 300.00,
"Source": "Shopify",
"Vendor Name": "845236547",
"Created At": "17th July 2023, 03:25:55 pm",
"Quantity": 2,
"Product ID": "845236547"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Product Title": "0:Sample Product01",
"Updated At": "17th July 2023, 03:26:15 pm",
"ID": "3cce6aeedf786679ac03e043729fd...",
"Variation ID": "0:123456",
"Currency": "USD",
"Checkout ID": "3cce6aeedf786679ac03e043729fd...",
"Source Name": "web",
"cart_token": "c1-fcdd3207bee3eef9f98abefaf2ca...",
"Checkout URL": "https://store.myshopify.com/products/snowboard",
"Shopify Customer Id": 36838667059499,
"Total Price": 327,
"Price": [0:300.00],
"Subtotal Price": 300.00,
"Source": "Shopify",
"Vendor Name": "845236547",
"Created At": "17th July 2023, 03:25:55 pm",
"Quantity": [0:1],
"Product ID": [0:845236547]
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Shipping Address Country": "US",
"Billing Address City": "New York",
"Product Title": "0:Sample Product01",
"cart_token": "c1-fcdd3207bee3eef9f98abefaf2ca...",
"ID": "3cce6aeedf786679ac03e043729fd...",
"Checkout ID": "3cce6aeedf786679ac03e043729fd...",
"First Name": "John",
"Currency": "USD",
"Shipping Address Country Code": "US",
"Billing Address Country Code": "US",
"Updated At": "",
"Source Name": "web",
"first_name": "John",
"Shipping Address Province": "New York",
"Checkout URL": "https://store.myshopify.com/products/snowboard",
"last_name": "Doe",
"Shopify Customer Id": 36838667059499,
"Total Price": 327,
"Price": 0:300.00,
"Shipping Address Zip": "10009",
"Subtotal Price": 300.00,
"Source": "Shopify",
"Shipping Address Province Code": "NY",
"Vendor Name": "845236547",
"Billing Address Country": "US",
"Created At": "17th July 2023, 03:25:55 pm",
"Variation ID": "0:123456",
"Quantity": [0:1],
"Product ID": [0:845236547]
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Current Total Discounts": 0.00,
"Product Title": "0:Sample Product01",
"cart_token": "c1-fcdd3207bee3eef9f98abefaf2ca...",
"ID": "3cce6aeedf786679ac03e043729fd...",
"Name": "#1008",
"Order Status URL": "",
"Total Quantity": 1,
"Billing Address Country Code": "US",
"Billing Address Zip": 10009,
"Order ID": 12334534345,
"Currency": "USD",
"Total Price": 354,
"Checkout ID": "3cce6aeedf786679ac03e043729fd...",
"First Name": "John",
"Order Number": 1008,
"Financial_status": "paid",
"Source": "Shopify"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"product_title": [0:"product 2", 1:"product 2"],
"Updated At": "17th July 2023, 03:25:57 pm",
"product_id": [0:234234324, 1: 97897897897],
"variation_id": [0:23423423423, 1:23423423444],
"Total Spent": 5687,
"Currency": "USD",
"Total Price": 354,
"Checkout ID": "3cce6aeedf786679ac03e043729fd...",
"tracking_company": "1",
"vendor_name": [0:"ShopiWeb", 1:"ShopifyWeb"],
"OrderID": 34343455,
"item_fulfilment_status": [0:"partial", 1:"fulfilled"],
"Quantity": [0:4, 1:3],
"item_count": 2,
"order_fulfilment_status": "partial",
"Subtotal Price": 10500,
"Order Status URL": "https://yourshopifystore...",
"price": [0:1500.00, 1:1500.00],
"variation_title": [0:"product 2 - black", 1:"product 2 - red"],
"Financial status": "refunded",
"Created At": "17th July 2023, 03:25:55 pm"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"product_title": [0:"product 2"],
"cart_token": "c1-fcdd3207bee3eef9f98abefaf2ca...",
"product_id": [0:234234324],
"variation_id": [0:23423423423],
"Total Spent": 5687,
"Currency": "USD",
"Total Price": 354,
"Checkout ID": "3cce6aeedf786679ac03e043729fd...",
"Source Name": "web",
"vendor_name": [0:"ShopiWeb"],
"item_fulfilment_status": [0:"fulfilled"],
"Updated At": "17th July 2023, 03:25:58 pm",
"OrderID": 34343455,
"Quantity": [0:1],
"item_count": 1,
"order_fulfilment_status": "fulfilled",
"Subtotal Price": 300,
"Order Status URL": "https://yourshopifystore...",
"price": [0:1500.00, 1:1500.00],
"variation_title": [0:"product 2 - black"],
"Financial status": "paid",
"Created At": "17th July 2023, 03:25:55 pm"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"product_title": [0:"product 2", 1:"product 2"],
"cart_token": "c1-fcdd3207bee3eef9f98abefaf2ca...",
"product_id": [0:234234324, 0:23423423446],
"variation_id": [0:23423423423, 0:84353458],
"Total Spent": 5687,
"Currency": "USD",
"Total Price": 354,
"Checkout ID": "3cce6aeedf786679ac03e043729fd...",
"cancelled at": "17th July 2023, 03:25:55 pm",
"Source Name": "web",
"vendor_name": [0:"ShopiWeb", 1:"ShopiWeb"],
"item_fulfilment_status": [0:"fulfilled"],
"Updated At": "17th July 2023, 03:25:58 pm",
"OrderID": 34343455,
"Quantity": [0:1, 1:2],
"item_count": 2,
"order_fulfilment_status": [0: , 1:],
"Subtotal Price": 300,
"Order Status URL": "https://yourshopifystore...",
"price": [0:1500.00, 1:1500.00],
"variation_title": [0:"product 2 - black", 1:"product 2 - red"],
"Financial status": "refunded",
"Created At": "17th July 2023, 03:25:55 pm"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Variation Title": [0:"Product 2 Black"],
"Product Title": [0:"Product 2"],
"Updated At": "17th July 2023, 03:25:59 pm",
"OrderID": 34343455,
"Variation ID": [0:234234234],
"Currency": "USD",
"email": "John.doe@example.com",
"user_id": 1545645465,
"Refund Created At": "17th July 2023, 03:25:55 pm",
"Source": "Shopify",
"Vendor Name": [0:"ShopifyWeb"],
"Created At": "17th July 2023, 03:25:55 pm",
"price": [0:500.00],
"Quantity": [0:1],
"Product ID": [0:8923423]
}Sample Payloads for Web SDK Events
{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Email": "john.doe@example.com",
"Product Title": "Sample Product",
"Variation ID": "123456",
"Total Variants": 3,
"Product Handle": "Product 1",
"Available": true,
"Currency": "USD",
"Product ID": "845236547",
"Price": 555.99,
"Source": "Shopify",
"Quantity": 3,
"First Session": true,
"URL": "https://yourstore.myshopify.com/products/view"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Variation ID": "123456",
"Currency": "USD",
"URL": "Search URL",
"Search String": "Sneakers Green",
"Source": "Shopify",
"First Session": true
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Email": "john.doe@example.com",
"Product Title": "Sample Product",
"Variation ID": "123456",
"Variation Title": "Sea Green",
"Total Variants": 3,
"Product Handle": "Product 1",
"Available": true,
"Currency": "USD",
"Product ID": "845236547",
"Vendor Name": "845236547",
"Price": 555.99,
"Source": "Shopify",
"Quantity": 3,
"First Session": true,
"Product URL": "/product/type?type=Sneakers"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Email": "john.doe@example.com",
"Product Title": "Sample Product",
"Variation ID": "123456",
"Variation Title": "Sea Green",
"Total Variants": 3,
"Product Handle": "Product 1",
"Available": true,
"Currency": "USD",
"Product ID": "845236547",
"Vendor Name": "845236547",
"Price": 555.99,
"Source": "Shopify",
"Quantity": 3,
"First Session": true,
"Product URL": "/product/type?type=Sneakers"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Email": "john.doe@example.com",
"Product Title": "Sample Product",
"Variation ID": "123456",
"Currency": "USD",
"Product ID": "845236547",
"Price": 555.99,
"Source": "Shopify",
"Quantity": 3
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Email": "john.doe@example.com",
"Source": "Shopify",
"First Session": true,
"URL": "https://yourstore.myshopify.com/"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Email": "john.doe@example.com",
"FirstName": "John",
"LastName": "Doe",
"Customer ID": 7385786908975,
"URL": "https://yourstore.myshopify.com/account"
}{
"Event Received Time": "17th July 2023, 03:25:55 pm",
"Email": "john.doe@example.com",
"currency": "USD",
"Total Price": 699.95,
"Product Prices": [699.95],
"Product IDs": ["8869819679023"],
"Product Quantities": [1],
"Product Titles": ["The Complete Snowboard - Ice"],
"Variation IDs": ["46822634324271"],
"Vendor Names": ["Snowboard Vendor"],
"Source": "Shopify",
"First Session": true,
"URL": "https://yourstore.myshopify.com/products/the-complete-snowboard"
}Tracked User Properties
MoEngage tracks the following user attributes when you enable them during integration.
| Attribute Name | Description |
|---|---|
| First Name | The first name of the user. |
| Last Name | The last name of the user. |
| Mobile | The mobile number of the user. |
| The email address of the user. | |
| Shopify ID | The user's ID within Shopify. |
| Shopify LTV | The lifetime value of the user |
Configuration for Event and User Tracking
To select the events and user properties that MoEngage tracks, perform the following steps:
- Navigate to the Configuration tab in your Shopify app.
- Select the user events and properties you want to track.
- Click Save configuration.
| info | If you have questions about your Shopify integration, refer to the MoEngage Shopify FAQs. |