Send Shopify Ecommerce Events to Twilio Segment and See True ROAS for Google and Meta

Meta and Google each claim credit for the same sales. Send Shopify's storefront and order events to Twilio Segment, and measure every campaign against the revenue Shopify actually booked.

  • Twilio Segment
  • Shopify
  • Ecommerce
  • ROAS
  • Google Ads
  • Meta Ads
  • Attribution
  • Twilio Segment
Meta reports $41,200 Google reports $37,900 Actual Shopify revenue $52,600 one number, every channel attribution

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_id onto 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.

Keep in mind that Shopify runs Web Pixels in a sandbox that can't load analytics.js, so Cloud-mode destinations receive these events and Device-mode destinations don't. If you rely on a Device-mode destination, add the Twilio Segment snippet to your theme yourself and set Pageview trigger method to disabled.

Which events drive ROAS?

Here are the events that matter most for ROAS. The events spec lists the rest.

Shopify sourceTwilio Segment eventWhy it matters
product_viewedProduct ViewedTop of the product funnel
product_added_to_cartProduct AddedIntent signal for retargeting
checkout_startedCheckout StartedFunnel entry, with cart value
Contact, address, and shipping steps, plus checkout_completedCheckout Step CompletedShows where checkout drops off, with shopify_step naming the step
orders/paid webhookOrder CompletedThe conversion and revenue ROAS runs on
refunds/create webhookOrder RefundedCarries negative revenue, so ROAS nets out returns
orders/cancelled webhookOrder CancelledFlags 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.

Keep in mind that Estimated First Order carries a revenue of 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.

Keep in mind that some iOS clicks carry 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:

The Shopify store sends Web Pixel and webhook events through the CDP Connector into Twilio Segment, which sends them to Attribution through the Actions destination. Google and Meta Ads send spend by campaign to Attribution, or spend is entered manually. Attribution credits every touchpoint, reports ROAS on Shopify revenue, and splits new from repeat buyers. Optionally, Attribution sends gclid traits back to Twilio Segment nightly, which passes them to Google Ads so it bids on Shopify revenue.
Shopify events reach Attribution through Twilio Segment, where they meet ad spend. Sending gclid traits back to Google Ads is optional.

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 to email only 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 to orders/fulfilled if you only count revenue once an order ships.
  • Customer Privacy Mode set to pass_through attaches 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.

JSON · Order Completed
{
  "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
      }
    ]
  }
}
Keep in mind that 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.

Keep in mind that only Google gets a click ID back. Attribution's reverse sync sends Last Conversion Gclid, and there's no matching trait for Meta. In Google Ads, create a conversion action for imported click conversions before you turn the mapping on. See Google's offline conversion import guide.

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.