For modern e-commerce advertisers, a purchase is rarely a single, linear action. A shopper might click an Instagram story ad on their phone, add an item to their cart while riding the subway, get distracted, and then finally buy it later on their work laptop. This behavior is called **cross-device switching**.
When shoppers switch devices, the client-side cookies that link their ad click to their final purchase are severed. Your ad account sees a view but no conversion, and your store looks like it’s getting organic sales. To solve this, GotTracked created a server-side recovery system: **Cart Attributes Session Healing**. Here’s a deep dive into how it works under the hood.
The Attribution Blindspot of Device Switching
Standard pixel-based conversion tracking (like Meta Pixel or Google Tag) relies entirely on browser storage (cookies, `localStorage`) to associate a visit with a click identifier (e.g., fbclid, gclid, ttclid). When a shopper switches devices or browsers, a blindspot occurs:
- Browser Boundaries: Local storage in Safari on an iPhone cannot communicate with Chrome on a Mac.
- ITP Cookie Lifespans: Even on the same device, if the visitor adds to cart but returns 8 days later, browser protections will have deleted the ad tracking parameters.
- App-to-Browser Jumps: Clicking a link in an email or SMS often opens in a default system browser (like Safari), losing the context of the in-app social browser session.
📊 The Attribution Gap: Studies show that over **30% of e-commerce checkouts** involve some form of device or browser switching. Traditional pixels miss these entirely, reporting them as direct/organic traffic.
How Cart Attributes Healing Works
GotTracked bypasses browser storage boundaries by using Shopify’s native database schema—specifically, **Cart Attributes**—to anchor session identifiers directly to the customer’s shopping cart on the server.
The 4-Step Healing Pipeline
| Step | Action | How GotTracked Executes It |
|---|---|---|
| 1. Capture | Extract Click IDs | Intercepts all incoming ad parameters (fbclid, gclid, ttclid) and UTM tags. |
| 2. Anchor | Write to Cart Attributes | Injects these parameters into Shopify's database under the current cart's metadata. |
| 3. Preserve | Server Caching | Associates the cart object with the customer profile in the Shopify backend. |
| 4. Heal | Stitch on Checkout | On payment completion, extracts the metadata from the webhook and links the click directly. |
Under the Hood: The Shopify Cart Object
Shopify’s /cart.js API allows developers to store key-value pairs associated with a specific shopping cart. These parameters are stored directly in Shopify's relational database, not in the visitor's local browser storage.
When GotTracked detects a tracking parameter, it executes a silent POST request to update the cart attributes:
// Example of a synthesized GotTracked Cart Attribute payload
{
"attributes": {
"_gt_fbclid": "IwAR3A9m...",
"_gt_gclid": "Cj0KCQjwl...",
"_gt_utm_source": "facebook",
"_gt_utm_medium": "paid-social",
"_gt_session_started": "1782298715"
}
}
Because these attributes are saved server-side within Shopify, they persist across all checkout steps. Even if the customer switches to an off-site payment gateway (like PayPal or Stripe) and returns to a different thank-you page browser session, Shopify passes the cart attributes directly into the final Order object payload.
Stitching the Attributed Session
When the shopper completes their checkout, GotTracked’s server receives an instantaneous order webhook. The payload contains the customer's PII (hashed to SHA-256) and the order's cart attributes.
Our server-side CAPI engine matches the cart attributes metadata against the order details, reconstructs the complete user journey, and sends a highly detailed, attributed event to Meta, Google, and TikTok. The ad platforms receive the conversion along with the correct click ID, restoring attribution accuracy to 99% and showing you exactly which ads are driving sales.
Frequently Asked Questions
What is cross-device attribution and why is it difficult?
Cross-device attribution means linking an ad click on one device (e.g., mobile) to a purchase completed on another (e.g., desktop). Standard cookie-based tracking cannot do this because cookies are stored per-device and per-browser. Click IDs are lost when users switch devices.
How does Shopify Cart Attributes help with cross-device tracking?
Shopify Cart Attributes is a server-side data store attached to a shopping cart, not a browser cookie. GotTracked writes click IDs (fbclid, gclid, ttclid) and UTM parameters to Cart Attributes when a user first lands on your store. These attributes persist even when the user switches devices, as long as they're logged into the same Shopify account or email.
Can I track a user who clicks an ad on mobile and buys on desktop?
Yes, if the user logs into your store or provides an email on both devices. GotTracked's Cart Attributes Healing can stitch the original mobile ad click to the desktop purchase using the shared customer identity, allowing the conversion to be correctly attributed.
How long are click IDs preserved in Shopify Cart Attributes?
GotTracked preserves click IDs (fbclid, gclid, ttclid) in Cart Attributes for up to 30 days. This is significantly longer than Safari's 7-day JavaScript cookie cap and covers the vast majority of purchase consideration windows.
Does cross-device stitching work for all ad platforms?
Yes. GotTracked's Cart Attributes Healing works for Meta (fbclid), Google (gclid), and TikTok (ttclid) simultaneously. When an Order webhook fires, GotTracked reads the stored click IDs and sends correctly attributed events to all three platforms at once.
Start Recovering Your
Lost Attribution Today
GotTracked sets up in under 15 minutes and is free for the first 2,000 pioneer merchants.