I am putting some tags on my website for tracking (not facebook Pixel, Bing or GA!) and one of the parameters i need to pass through is the cart id from a user session.
I am familiar with the liquid variables and have being using them for the rest of the tags but there does not seem to be a liquid tag available for a cart id.
My question is - Is there a way of extracting a cart ID from a user session? in order for it to be passed as a parameter
I'm not sure, but I think the ID is assigned the first time a cart gets submitted to checkout. Which would make sense, as the ID wouldn't be needed before then and assigning one to every cart even before going to checkout would result in tons of useless IDs being generated.
The URL for my checkout is the following
I'm assuming the ID is 15334581 as this is consistent with the ID on the abandoned baskets page. Is this correct?
Cheers for your help, really appreciated
I'm trying to display an id to the active customer on the cart screen, but preferably an easier one than is shown in the URL.
I would like the customer to be able to call us on the phone while on the website and tell us the id, we could then look at the cart items on our end and assist the customer with any questions.
@ogeid nothing that's really going to be natively supported.
You could try using line item properties, cart.note or cart.attributes so a keyword|phrase|slug|product-handle is on a hidden line item or the cart?
Can't really use in the url since the param will just resolve to a clean url or redirect, though maybe a redirect with a param might keep it visible?
Abandonded cart doesn't seem to search those fields though only higher level entries like product title,etc.
Not tested if this is an immediate limitation or if shopify indexes after awhile and then becomes searchable
You will need to come up with a word generation scheme to avoid collisions which is the point of the checkout ID in the first place similar.
If trying to transform the checkout.id to human friendly phrase then you'd still have to work out the mapping between a customers identity "phrase" and the actual ID...
for performance you'd want an app to generate these hashwords and not on the customers browser but i've yet to see a library for the front end only the backend
THEN also have that mapping useable by your support to find the actual checkout.ID
Of course none of this applies if your using a separate app that doesn't a facilitate this.
You can pull the info from https://shopify.com/admin/checkouts.json though remember pagination so try to filter such lists first.
Advanced is to make a browser extension|bookmarklet that fetches the cart.note or cart.attribute and displays it in the abandoned checkouts list so you can find it with ctrl+f.
or manually ctrl+f in the json for the customers support-phrase, get the related checkout.id then search in the list,
or just get the abandoned.id number and append it to /checkouts/1234567890
there are also open source json viewer browser extensions that could be made to make the abandoned-checkout.ids clickable links too.