Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
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.
Vix | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development 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.
Vix | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development 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.
Vix | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
User | RANK |
---|---|
3 | |
2 | |
1 | |
1 | |
1 |