attribution: carry session + campaign identity into shopify orders - #392
Draft
sshane wants to merge 1 commit into
Draft
attribution: carry session + campaign identity into shopify orders#392sshane wants to merge 1 commit into
sshane wants to merge 1 commit into
Conversation
The marketing site and the shop are different origins, so Shopify sees none of our attribution: landing_site is just the cart permalink (/cart/c/<token>) and note_attributes is empty on all of the last 250 orders. mc_cid reaches comma.ai fine (1,921 pageviews in 30d) and now survives the harness rewrite, but nothing forwards it into the cart. Capture each inbound touch to localStorage and write it into the cart, where it lands in order.note_attributes and can be queried from the Admin API alone. - first touch is frozen; last touch is overwritten ONLY on a real touch (tracking param or external referrer). A direct return must not clobber an earlier campaign touch -- 67% of buyers convert across more than one session and 33% take more than a day, so that case is the norm. - carts persist in localStorage across visits, so refresh attributes via cartAttributesUpdate at checkout rather than trusting cart-create time. - mc_eid identifies the person on an email click with no form submission; the signup form attaches the email. Both give cross-device stitching that device-local storage cannot. Verified in a browser: campaign touch survives a direct return with no params and no referrer, and cartAttributes() emits distinct_id, session_id, mc_cid and both touch blobs. Not included: the orders/create webhook that posts a purchase event back to PostHog. That closes the funnel and needs somewhere to run.
Contributor
deployed preview: https://comma-web--pr392-qpaw773j.web.appWelcome! Make sure to:
|
sshane
marked this pull request as draft
September 9, 2026 23:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The marketing site and the shop are different origins, so Shopify sees none of our attribution: landing_site is just the cart permalink (/cart/c/) and note_attributes is empty on all of the last 250 orders. mc_cid reaches comma.ai fine (1,921 pageviews in 30d) and now survives the harness rewrite, but nothing forwards it into the cart.
Capture each inbound touch to localStorage and write it into the cart, where it lands in order.note_attributes and can be queried from the Admin API alone.
Verified in a browser: campaign touch survives a direct return with no params and no referrer, and cartAttributes() emits distinct_id, session_id, mc_cid and both touch blobs.
Not included: the orders/create webhook that posts a purchase event back to PostHog. That closes the funnel and needs somewhere to run.