How to get UTM parameters and referrer of user session

Topic summary

Main issue: capturing UTM parameters and referrer for user sessions in a Shopify store when no order is placed.

  • Current capability: UTM data is available via Order.CustomerJourney, but only after a purchase. CustomerJourney is a Shopify object that records a buyer’s path and related campaign parameters.
  • Desired outcome: collect UTMs and referrer for visitors on any page (home, product, etc.) without requiring an order.
  • Attempted approach: reading Shopify analytics cookies (_shopify_sa_p and _shopify_sa_t), but the original poster couldn’t get them to work.
  • New idea shared: define conditional UTM parameters using the “Customer left online store without making a purchase” trigger (likely via an automation/flow). An image was posted showing this trigger, but no implementation details or results were provided.

Status: unresolved. No confirmed method for reliably capturing UTMs/referrer for non-purchasing sessions was agreed upon. Open question: how to persist and access session-level UTMs/referrer across pages without relying on an order.

Summarized with AI on December 13. AI used: gpt-5.

Does anyone knows how to get the UTM parameters and Referrer of a user session?

I know it is possible to get the UTM parameters through Order.CustomerJourney object but it assumes that a customer placed an order.

I am looking for a solution that will work if a customer does NOT order anything. For example, if someone is simply visiting a home page or a product page, and any other page on my store.

I have found some suggestions on the internet to look into _shopify_sa_p and _shopify_sa_t cookies but I could not get it working

I’m brainstorming solutions to the same issue now, so far the closest I’ve come is the ability to define conditional utm params based on the “Customer left online store without making a purchase” trigger. Did you ultimately solve your problem?