Shopify Attribution Cookies Explained: _shopify_sa_p, _shopify_sa_t, and UTM Tracking
Shopify doesn't document _shopify_sa_p or _shopify_sa_t. What its cookie policy lists instead, where each order's first and last visit are stored, and how the 30-day lookback shapes credit.
Three platforms, three answers, one budget to defend. Your GA4 export already holds the answer, and the first finding is free and never leaves your browser. Get your first finding free
By Joris van Huët, Founder & CEOUpdated 5 min read
Run the numbers for your store: the free UTM builder.
Shopify Attribution Cookies Explained: _shopify_sa_p, _shopify_sa_t, and UTM Tracking
Short answer, checked on 28 September 2026: Shopify does not document _shopify_sa_p or _shopify_sa_t. Neither cookie appears in Shopify's cookie policy, last updated 18 September 2026, or in Shopify's developer changelog. Any page that tells you exactly what they store, or how long they last, is guessing.
That included an earlier version of this page. It said both cookies lasted 30 days and listed the fields inside them. Shopify documents neither, so both claims are gone.
What Shopify does document is where marketing attribution lives: on the order, in the customer journey, not in a cookie you can read.
What Shopify's cookie policy lists today
| Cookie | What Shopify says it does | Lifetime |
|---|---|---|
_shopify_s | "Used to identify a given browser session/shop combination" | 30 minutes, rolling |
_shopify_y | "Shopify analytics" | 1 year |
_shopify_marketing | "Contains marketing data for buyer surfaces such as the storefront or checkout" | 1 year |
One wrinkle. Shopify's developer changelog of 4 August 2025 says storefronts stopped setting _shopify_y and _shopify_s on 1 January 2026 and points developers to the Web Pixels clientId instead, while the policy still lists both. When two Shopify documents disagree about a cookie, don't build reporting on that cookie.
Third-party cookie databases describe _shopify_sa_p and _shopify_sa_t as short-lived marketing and referral cookies. The popular reading of "p" as a persistent first touch and "t" as a temporary last touch has no Shopify source.
Where Shopify's attribution actually lives
Every online store order carries a customer journey. In the Admin API, CustomerJourneySummary holds:
firstVisit: "The customer's first session going into the shop."lastVisit: "The last session before an order is made."daysToConversion: the number of days between the first session and the order.momentsCount: how many sessions and other moments came before the order.
Each visit, a CustomerVisit, records its source (a platform such as Facebook or Google, email, direct, a website domain, a QR code or unknown), referrerUrl, landingPage, occurredAt, a referralCode taken from a ref, source or r parameter, and utmParameters gathered from the URL. That is a documented first touch and last touch for every order, and you can export it.
In the admin, the same data is the order's conversion summary: where the first visit came from, the number of visits in the last 30 days, and the days between the first and most recent visit. When cookies were blocked, Shopify shows a limited summary, or none.
How Shopify credits a sale
Shopify offers five attribution models, and which one you see first depends on where you look. In the marketing reports under Analytics, Last click is selected by default when a report has sales metrics and marketing dimensions. In the Marketing section's activity data, the default is Last non-direct click. Same store, same orders, two defaults.
| Model | Who gets the credit |
|---|---|
| Last click (default in Analytics reports) | The last channel, direct visits included |
| Last non-direct click (default for marketing activity) | The last channel before the purchase, skipping direct visits |
| First click | The first channel, direct visits included |
| Any click | Every channel that was clicked, each with full credit |
| Linear | Every click, in equal shares |
Both pages work on 30 days: the marketing activity data uses a 30-day lookback, and in the reports a visitor who doesn't buy within 30 days gets a new first interaction. Attribution data can take up to 24 hours to update. A buyer whose first visit came 31 days before the order falls outside that window, whichever channel found them. The attribution window entry covers how that choice moves credit.
How UTM parameters get in
UTM parameters on the landing URL are what fill utmParameters on a visit. Without them, Shopify works from the referrer, which a redirect, an in-app browser or a privacy setting can strip, and the visit reads as direct or unknown. The one part you fully control is the link, so tag every paid, email and influencer link with one naming scheme. The free UTM builder keeps it consistent.
Where cookie-based attribution breaks, on any store
- Safari. Since ITP 2.1 (February 2019), "all persistent client-side cookies, i.e. persistent cookies created through document.cookie, are capped to a seven day expiry." A Safari buyer who returns after a week can look like a new visitor.
- Devices. Cookies live in one browser. A click on a phone and a purchase on a laptop are two strangers.
- Views. A visit starts with a click. Someone who watched five ads and then searched your name is credited to the search. See view-through conversions.
- Consent. When a visitor blocks cookies, the conversion summary is limited or missing.
None of these shows up as a warning. The report just grows more confident about the channels it can still see, and every ad platform reports its own number with the same confidence.
What to do with it
- Export
customerJourneySummaryfor last quarter's orders and count the orders whose first visit came from a different source than the last. That share is how often a last click model hands the credit to a channel that didn't start the journey. - Switch the marketing report between first click and last click for the same quarter. Channels whose credit swings hard between the two are the ones worth testing.
- Before a big budget change, run a holdout test: pause one channel in part of your market for two weeks and compare store orders.
The first finding is free and runs in your browser; the full read is €99 once, excluding VAT.
Go deeper: Causal attribution, explained.
Sixty-second versions of these ideas: Causality Engine on YouTube Shorts.
Have an audience of ecommerce operators? Earn 20% recurring commission by recommending the €99 read.
Keep reading
Terms in this article
- Attribution ModelAn Attribution Model defines how credit for conversions is assigned to marketing touchpoints. It dictates how marketing channels receive credit for sales.
- Attribution WindowAttribution Window is the defined period after a user interacts with a marketing touchpoint, during which a conversion can be credited to that ad. It sets the timeframe for assigning conversion credit.
- Cookie PolicyCookie Policy informs users about website cookie use and how the site collects and uses their data.
- Customer journeyCustomer journey is the path and sequence of interactions customers have with a website. Customers use multiple devices and channels, making a consistent experience important.
- Holdout TestA holdout test is an experiment that keeps a random part of an audience from seeing a campaign and compares its results with those of the part that could see it. The held-out part is the control group, so the gap in outcomes estimates what the campaign added.
- Marketing AttributionMarketing attribution assigns credit to marketing touchpoints that contribute to a conversion or sale. Causal inference enhances attribution models by identifying true cause-effect relationships.
- Third-Party CookieThird-Party Cookie is a cookie set by a domain other than the one a user currently visits. These cookies track users across sites for advertising.
- UTM ParametersUTM Parameters are URL tags marketers use to track campaign effectiveness across traffic sources. They provide data for accurate campaign tracking and attribution in analytics platforms.