Add custom attributes from Script Tag

aespinosa
Shopify Partner
4 0 0

Hi! I'm trying to add custom attributes to orders through query params in the url. For example, I want to know the client's username in the app from where I redirected them.

I tried creating a script tag that takes the query param and adds it to the cart as an attribute using the Ajax API. The problem is that if the client clicks the "Buy it now" button instead of using the cart, my approach doesn't work. Does anyone know any other way of achieving this?

Reply 1 (1)
Leif_Leroy
New Member
4 0 0

Hello, did you ever find a solution to this?