Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hello!
I create a ScriptTag through scriptTagCreate:
gql` mutation scriptTagCreate($input: ScriptTagInput!) { scriptTagCreate (input: $input) { userErrors { field message } scriptTag { src displayScope } } } ` input: { src: 'https://my-domain.com?text=test', displayScope: 'ALL', },
But instead of the expected:
<script src="https://my-domain.com?text=test"></script>
I get:
<script src="https://my-domain.com?text=test&shop=my-shop.com"></script>
How do I create a ScriptTag without the "shop" parameter?
Solved! Go to the solution
This is an accepted solution.
Hi @Kostya
The shop=
param is automatically appended to the final version of your script that is injected on the Shopify's liquid template. You are able to grab that param if needed and apply customizations or modify your code in any way based on the shop. You would not be able to remove that through the API. Everything you are passing looks to be correct.
To learn more visit the Shopify Help Center or the Community Blog.
This is an accepted solution.
Hi @Kostya
The shop=
param is automatically appended to the final version of your script that is injected on the Shopify's liquid template. You are able to grab that param if needed and apply customizations or modify your code in any way based on the shop. You would not be able to remove that through the API. Everything you are passing looks to be correct.
To learn more visit the Shopify Help Center or the Community Blog.
Hello , Doo you know how can I remove a scriptTag using the shopify Admin.
Thanks a lot!!
Hey @jandri78Dev
You can remove that through the API: https://shopify.dev/docs/admin-api/rest/reference/online-store/scripttag#destroy-2020-01
Did you mean through the admin itself? If so, you will need to go into the theme code.
To learn more visit the Shopify Help Center or the Community Blog.