I’m new to shopify.
I need a way to map a particular order to user’s session. I.e what is the session ID in which that particular orders is placed.
Checking the REST API response of orders, there is no particular mapping like this.
There is a field called session_hash
but it is mostly NULL value (even if it is not NULL how to decipher hash)
Is there any way to find this
- Any particular field in Order REST API/GraphQL which can directly give session ID
- Any custom way, where I can log an event just before checkout API is called for placing a new order
- Any other hacky way, like combination of broswerIP + userID + to uniquely identify a unique user session in which an order is placed.
Basically I’m calculating an analytics : (sessions in which an order(s) is placed) vs total unique sessions
-----------
Link to order Rest API : Order (shopify.dev)
For Session ID I’m fetching it via & saving it into my backend:
ShopifyAnalytics.lib.user().traits().uniqToken