Is there a way to pass the handle to a script tag?

Hey, our app is using the script tag API to inject our script and then fetch some data related to the product page from our API.

But it’s pretty slow and I’d like to know if there’s a way to know the product handle from the request loading the script tag ?

Thanks by advance

Hey @lucas-p

It’s best to parse window.location.pathname in these cases.

Thanks, this is what we’re already doing :slightly_smiling_face:

I wanted to see if there was no other way to directly pass the handle to the script tag so we can load data at the start and not wait for an extra API call.

But it seems a bit tricky if we’re obliged to modify the liquid files.

1 Like