How not to add the "shop" parameter to src when creating a ScriptTag?

Solved
Tourist
4 0 0

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?

0 Likes
Highlighted

Success.

Shopify Staff
Shopify Staff
190 21 21

 

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? Click Accept as Solution 


1 Like