Persisting URL cart attribute query parameters from the product page to the cart

ryanwhittaker
New Member
1 0 0

Hello!

I'm looking to persist query parameters from the product page or homepage, all the way through to the checkout so that they are stored as cart attributes.

An example of what it would look like:
https://www.hydroponicsgreenhouse.com/products/mediterranean-refresh-third-edition?variant=323408562...

In this case I'd want the eftid cart attribute to pass through to the checkout, to allow it to be accessible in the Additional Scripts area on my store.

An example of a cart where this works:
http://hydroponicsgreenhouse.com/cart/32340856242270:1?attributes[eftid]=123

As an easy solution, persisting the query parameters through the entire site to the checkout seems like an obvious solution, but I'm wondering if there's either a Shopify setting or app that allows this, or if I should be coding it myself.

If I can't persist the query parameters through, are there any storeable attributes that can be used on the frontend of the site before the cart (ie. product page), that is accessible on the Additional Scripts area of the Receipt. IE. using utm parameters in the URL and printing this URL parameters in additional scripts.

Thanks!

0 Likes