In this post, you will learn how to send Shopify storefront and order events to Twilio Segment, and measure ROAS for every Google and Meta campaign on your actual Shopify revenue.
Meta and Google each keep their own conversion, attribution, and revenue data, and each one gives itself credit for the same sale. Meta also counts view-through conversions from people who saw a campaign but never clicked. Add the platforms up and you often get more revenue than you actually booked. Multi-touch attribution clears that up by crediting each order once, across every touchpoint that led to it.
Attribution's CDP Connector for Segment sends Shopify events to Twilio Segment using the Twilio Segment V2 Ecommerce Spec. Attribution then ties each paid order to every touchpoint and the spend behind it. Revenue in Attribution is your actual Shopify revenue, net of taxes, shipping, and refunds, so ROAS by campaign runs on what you really kept.
There's no storefront code to write. Everything below is set up in Shopify, Twilio Segment, and Attribution.
Prerequisites
To get started you will need:
- Admin access to your Shopify store.
- A Twilio Segment source for the store, connected to the Attribution (Actions) destination with your Attribution Project ID. See the Twilio Segment setup guide.
- Google Ads and Meta Ads connected in Attribution, so spend arrives by campaign, with Google Ads auto-tagging turned on and Attribution's auto-tagging turned on for Meta. See the Google Ads and Meta Ads guides. Spend for platforms you haven't connected can be entered manually in Attribution. See the ad integrations overview.
- Optional Segment Reverse - Identity turned on in Attribution and the Google Ads Conversions destination in Twilio Segment, if you want Google to bid on attributed revenue. See the reverse sync setup guide.
What is the CDP Connector for Segment?
The CDP Connector is a Shopify app with three parts:
- Web Pixel: sends storefront events to Twilio Segment in real time, including every checkout step.
- Webhook: turns Shopify order webhooks into Twilio Segment order events.
- UI Extension: the optional Attribution Analytics app embed. It writes the visitor's
anonymous_idonto the cart, so orders carry the same identity as the visits before them.
Timing matters here. Shopify stops running script tags on March 1, 2027, so any tracking that loads through a script tag stops with it. The connector uses Shopify's Web Pixel instead, which gets past most ad blockers and sends events to Twilio Segment in Cloud mode.
disabled.Which events drive ROAS?
Here are the events that matter most for ROAS. The events spec lists the rest.
| Shopify source | Twilio Segment event | Why it matters |
|---|---|---|
product_viewed | Product Viewed | Top of the product funnel |
product_added_to_cart | Product Added | Intent signal for retargeting |
checkout_started | Checkout Started | Funnel entry, with cart value |
Contact, address, and shipping steps, plus checkout_completed | Checkout Step Completed | Shows where checkout drops off, with shopify_step naming the step |
orders/paid webhook | Order Completed | The conversion and revenue ROAS runs on |
refunds/create webhook | Order Refunded | Carries negative revenue, so ROAS nets out returns |
orders/cancelled webhook | Order Cancelled | Flags orders that never turned into revenue |
For Attribution, the connector also fires an Estimated First Order event for customers who bought from you before you connected. Order data in Attribution starts on your connection date, so this event records each existing customer's original first purchase date. That lets the First Time Purchasers report separate new customers from repeat buyers from day one.
0.01. That's enough to mark the customer's first purchase without adding to your revenue totals.How does Attribution tie orders to Google and Meta campaigns?
Attribution follows every touchpoint on the path to an order, not just the last click. For Google Ads, it uses the gclid that Google's auto-tagging adds to each click, and resolves every click to its campaign, ad group, and keyword. UTM parameters are the backup when a click arrives without one. See the Google Ads guide.
For Meta, Attribution's auto-tagging adds the ad ID (fbaid) to each link, so a visit ties to the Meta campaign and ad set behind it without relying on UTMs. See the Meta Ads guide. Most other platforms are tracked through UTM parameters, but Google and Meta have this stronger signal available.
gbraid or wbraid instead of a gclid. Attribution groups them under Google Ads Web/App & App/Web clicks, because Google doesn't tie them to a specific campaign or ad group.How the data flows
Shopify events reach Twilio Segment through the connector and pass to Attribution, where they meet ad spend. Sending gclid traits back to Google Ads is the optional last step. See below for how the pieces connect:

Why use Twilio Segment and Attribution for true ROAS
For example, with this setup you can:
- Use one revenue number across Meta, Google, and every other channel: your Shopify revenue.
- Land the checkout funnel in Twilio Segment step by step, ready for any Cloud-mode destination.
- See which campaigns bring in first-time customers and which bring back repeat buyers, in the First Time Purchasers report.
- Skip maintaining storefront tracking code ahead of Shopify's script tag cutoff.
Here's how this compares with reading ROAS inside each ad platform:
- Each platform counts the conversions its own pixel saw, and Meta adds view-through conversions on top. Attribution counts each Shopify order once and splits credit across every touchpoint on the path.
- Platform revenue doesn't drop when an order is refunded. Order Refunded takes it back out in Attribution.
- Platform ROAS only includes that platform's spend. Attribution puts every channel's spend against the same revenue, including spend you enter manually.
Setting it up
Step 1: Install the CDP Connector
Sign in to Shopify as an admin and install CDP Connector for Segment from the Shopify App Store. Finish onboarding, and the Web Pixel installs itself.
Step 2: Turn on the app embed
In the Shopify theme editor, go to Theme settings › App embeds and turn on Attribution Analytics. The embed is set per theme, so turn it on again whenever you publish a new theme.
Step 3: Check three settings
In the connector's settings, check these three before any data flows:
- User ID source defaults to
shopify_customer_id. Switch it toemailonly if email is the user ID everywhere else in Twilio Segment. - Order Completed Trigger Topic defaults to
orders/paid, which fires when payment is received. Switch it toorders/fulfilledif you only count revenue once an order ships. - Customer Privacy Mode set to
pass_throughattaches each customer's consent to every event without blocking it. The setting is in beta.
Here's an Order Completed event as it lands in Twilio Segment. The values are illustrative; check your own in the source debugger.
{
"type": "track",
"event": "Order Completed",
"userId": "7344837845231",
"anonymousId": "0db4b712-1aee-4173-be25-1bf3dfa00811",
"properties": {
"order_id": "#1042",
"total": 156.45,
"revenue": 138.00,
"shipping": 8.00,
"tax": 10.45,
"currency": "USD",
"checkout_token": "a1b2c3d4",
"source_name": "web",
"products": [
{
"product_id": "8741523456789",
"sku": "TEE-BLK-M",
"name": "Example T-Shirt",
"price": 69.00,
"quantity": 2
}
]
}
}revenue leaves out shipping and tax, so this order counts as 138.00 in Attribution, not the 156.45 total. Also, order_id is the Shopify order name, such as #1042, not the internal order number.Step 4: Connect Attribution in Twilio Segment
If the store's source isn't connected yet, add the Attribution (Actions) destination to it in Twilio Segment and paste in your Attribution Project ID. The default Send Events mapping forwards everything Attribution needs. See the Twilio Segment setup guide.
Step 5: Read true ROAS in Attribution
In Attribution, create a saved view with Order Completed as the conversion event, and break the dashboard down by Google and Meta campaign. ROAS now runs on Shopify revenue against the spend Attribution pulls from your ad platforms, or spend you enter manually for platforms that aren't connected. Switch between attribution models to see which campaigns hold up under each one.
Step 6: Close the loop with Google Optional
In Attribution, go to Settings › Conversion Integration and open Segment Reverse - Identity. Select Last Conversion Gclid, Last Conversion Google Percentage, and Last Conversion Google Attributed LTV. Attribution sends them to Twilio Segment as traits each night. See Available Data for the full list.
In Twilio Segment, add Google Ads Conversions, connect it with a Google account on your Google Ads account, and enter your Customer ID. In the Upload Click Conversion action, map GCLID to Last Conversion Gclid and Value to the attributed value you want Google to bid on. Set both consent fields, since Google rejects users sent as DENIED. See the Google Ads Conversions docs.
What to do next
With true ROAS in place, open the First Time Purchasers report to see which campaigns bring in new customers and which bring back repeat buyers. The campaigns that bring in your best new customers make a strong lookalike seed for Meta and Google, built from the LTV traits Attribution sends back to Twilio Segment.
You can also ask Claude, connected through the Attribution MCP server, which Meta campaigns lost money last month on Shopify revenue. We can't wait to see what you do with a ROAS number every team agrees on.


