Shopify CDP Connector Usage
Step-by-step guide for installing and configuring the CDP Connector to integrate Segment's customer data platform with your Shopify store for comprehensive event tracking.
Installing CDP Connector
Log in to your Shopify Store as an admin and install Attribution CDP Connector for Segment from the Shopify App Store.
Once you complete the onboarding steps, CDP Connector will automatically install its Web Pixel on your store and begin collecting data. It does not add the Segment snippet (analytics.js) to your storefront.
Web Pixel and Segment Cloud Mode
Shopify is retiring script tags, the way apps used to add scripts such as the Segment snippet to a storefront: apps can no longer add or update them, and Shopify stops running existing ones on March 1, 2027. CDP Connector uses Shopify's Web Pixel instead. It provides the same pageview, identify and ecommerce event coverage the Segment snippet did, with better accuracy: it bypasses most ad blockers, doesn't depend on a script loading in the page, and also captures checkout steps.
Shopify runs Web Pixels in a sandbox that cannot load analytics.js, so events reach Segment in Cloud Mode: your Cloud-mode destinations receive them, Device-mode destinations do not. If you rely on Device-mode destinations, see "Manually Installing Segment Snippet" below.
Understanding How CDP Connector Works
CDP Connector consists of multiple modules working at different levels. While each module operates independently, all modules are required to ensure the most accurate data collection.
- Web Pixel - Translates and sends native Shopify Standard events to Segment, including form submissions and custom events. For a full list of events, see the "Shopify Web Pixel Events" section of Shopify CDP Connector Events Spec. Fires
page()calls when "Pageview trigger method" is set toweb_pixel, the default (see "Settings" section below). - Webhook - Captures Shopify webhooks and translates them into Segment "Order" events. For a full list, see "Webhook Events" in the Shopify CDP Connector Events Spec.
- UI Extension - (Optional) The "Attribution Analytics" app embed block of your theme. Updates the Shopify cart with
anonymous_idso that Order events carry the visitor identity.
Connecting Attribution in Segment
You can connect Attribution as a destination in Segment. While this step is optional, it helps us validate correct data collection and identify any issues you might encounter. If Attribution is not connected in Segment, we will not be able to see your data since CDP Connector is a standalone application that works as a pass-through and doesn't store any data.
Identity Resolution and "anonymous_id"
CDP Connector resolves customer identity from their first visit through to purchase. The identify() call may fire multiple times along the visitor journey—on login, during checkout, and from webhook events. If a Shopify Customer ID is available, it will be used as the user_id. We attempt to keep anonymous_id consistent across the entire visitor journey, however this isn't always possible due to multiple factors such as ad blockers, customer network connection issues, and others.
By default, the Shopify cart is updated to include analytics_anonymous_id, which later becomes available on the Order object in Shopify webhook. CDP Connector then fires Order events with anonymous_id included, though this isn't always the case. The user_id is set by default (resolving to the Shopify customer ID) on all Order events. You may often see Order events without anonymous_id but with user_id. In these cases, you'll need to search for pageviews with the same user_id from the identify() call to find matching visitors.
This follows the recommended Segment approach: first try to resolve identity using user_id, then fall back to anonymous_id.
Consent Management
CDP Connector has native support for Shopify's Customer Privacy API and can translate its events into Segment Consent Management events and spec. If you use a third-party consent management system and want to integrate it with CDP Connector, you need to configure your consent management system to properly set data processing in Shopify's Customer Privacy API, and CDP Connector will work with it automatically.
By default, consent management is disabled. See the "Settings" section below for configuration options.
Shopify Headless Stores
If you're running a headless store, the only CDP Connector component that will work is "Webhook" (see above). This means you'll need to install Segment manually in your store. Additionally, your Order events will not have anonymous_id unless you set analytics_anonymous_id on cart.attributes in Shopify. If you use a combination of Shopify Storefront and a headless store, you can use the source_name property of Order events to identify where the order originated.
Manually Installing Segment Snippet
If you rely on Segment Device-mode destinations, install and manage the Segment snippet in your theme yourself. CDP Connector keeps sending its "Web Pixel" and "Webhook" events. Set "Pageview trigger method" to disabled in the settings so that pageviews come only from your Segment snippet and are not counted twice. We strongly recommend also enabling "UI Extension" as it allows proper anonymous_id synchronization between your manual Segment installation and CDP Connector.
UI Extension
This is a small Shopify theme app extension (the "Attribution Analytics" app embed block) that updates the cart to set anonymous_id. This allows CDP Connector to maintain consistent visitor identity across the entire customer journey and significantly improves data collection accuracy. It is required when using a manual Segment installation.
Activate it in the Shopify theme editor: Theme settings → App embeds → Attribution Analytics. The activation is per theme, so enable it again if you publish a different theme.
Settings
CDP Connector provides extensive configuration options to customize data collection and event tracking behavior. Access CDP Connector settings through the Shopify admin panel after installing the app.
Core Configuration
User ID Source
Determines which Shopify customer property is used as the user_id in tracking events:
- shopify_customer_id (default) - Uses internal Shopify customer ID
- email - Uses customer's email address
- none - Doesn't set
user_id, relies only onanonymous_id
Order Completed Trigger Topic
Determines which webhook triggers the "Order Completed" event:
- orders/paid (default) - Fires when payment is received
- orders/fulfilled - Fires when the order is fulfilled
Web Pixel Configuration
Web Pixel
The Web Pixel is installed automatically and is always on. It sends your storefront events to Segment in real time; the settings below control what it sends.
Pageview trigger method
- web_pixel (default) - Sends page calls using the Shopify Web Pixel without loading the Segment snippet (Cloud-mode, more reliable).
- disabled - Does not load the Segment snippet and does not send any page calls. No pageview tracking from CDP Connector. Useful if you install your own Segment snippet and do not want double pageviews.
- script_tag - Deprecated. Loaded the Segment snippet through a Shopify script tag (Device-mode). Shopify no longer allows apps to create or update script tags and stops running them on March 1, 2027; stores still using this method are moved to
web_pixelbefore that date. If you rely on Device-mode destinations, install the Segment snippet in your theme yourself and set this option todisabled.
Track Form Submitted
Enabled by default. Captures Shopify's form_submitted DOM events, useful for newsletter signups and custom forms. Implementation depends on your store's theme.
Track Custom Events
Enabled by default. Captures custom events sent via Shopify.analytics.publish() and forwards them to Attribution or Segment.
Send Raw Shopify Event Data
When enabled, attaches the original Shopify event data as shopify_event_data property on all Web Pixel events. Useful for debugging or accessing additional Shopify-specific properties.
Privacy & Consent
Customer Privacy Mode
This feature is currently in beta.
Controls how CDP Connector handles Shopify's Customer Privacy API:
- disabled (default) - Doesn't send
context.consentor honor Shopify Customer Privacy settings. All events are sent regardless of customer consent preferences. - pass_through (recommended) - Attaches
context.consentto all events as set in Shopify's Customer Privacy API, but still sends all events regardless of user consent preferences. This allows you to later decide in Segment how to enable the data. - strict (experimental) - Fully honors Shopify Customer Privacy settings. Blocks and queues all events until customer consent is obtained. Only sends events for customers who have opted in. Attaches
context.consentto all allowed events.
See the "Consent Management" section above for more details on integration with consent management platforms.
Advanced Settings
Extended Line Item Properties
Adds extra beyond-spec fields to each item of products[] in webhook-based Order events. Disabled by default; the following properties can be enabled individually:
presentment_amount- unit price in the currency presented to the customerpresentment_currencyproduct_properties- line item custom attributes as a key/value object; attributes with empty values are skipped
Additional Order Properties
Attaches extra fields from the Shopify Order to all webhook-based Order events (Order Created, Order Paid, Order Completed, etc.) as event properties. Pick the fields from the dropdown — it lists everything available, from top-level fields like payment_gateway_names or presentment_currency to nested ones like shipping_address.city or customer.tags (nested fields use dot notation).
Each selected field is added to the event payload under the exact key you picked, with the value taken from the Shopify webhook:
{
"event": "Order Completed",
"properties": {
"payment_gateway_names": "shopify_payments",
"shipping_address.city": "Toronto",
"total_price_set.presentment_money.amount": "156.45"
}
}- Array values are joined into a comma-separated string, e.g.
payment_gateway_names→"visa, paypal". - Fields that are empty or missing on a given order are omitted from that event.
- Order Edited events are built from an API lookup rather than the webhook payload, so additional order properties are not attached to them.
Additional Customer Traits
Adds extra fields from the Shopify Customer to the identify() calls that accompany Order events. Pick the fields from the dropdown — names follow Shopify's GraphQL Customer schema (camelCase), with dot notation for nested fields, e.g. locale, verifiedEmail, defaultAddress.city, lastOrder.name.
In the resulting traits, names are converted to snake_case and nested fields become nested objects:
{
"traits": {
"locale": "en-CA",
"verified_email": true,
"default_address": { "city": "Toronto" }
}
}Traits that are empty for a given customer are omitted.
Debug Mode
Enables verbose logging for troubleshooting and attaches additional properties to events.
Updated about 17 hours ago
