scriptTagCreate mutation
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
cache (
Boolean
)Whether the Shopify CDN can cache and serve the script tag. If
true
, then the script will be cached and served by the CDN. The cache expires 15 minutes after the script tag is successfully returned. Iffalse
, then the script will be served as is. -
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
cache (
Boolean
)Whether the Shopify CDN can cache and serve the script tag. If
true
, then the script will be cached and served by the CDN. The cache expires 15 minutes after the script tag is successfully returned. Iffalse
, then the script will be served as is. -
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.
Creates a new script tag.
Required access
write_script_tags
access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
Arguments
Argument | Description |
---|---|
input
(
ScriptTagInput!
)
required
|
Specifies the input fields for a script tag. |
ScriptTagInput fields
-
displayScope (
ScriptTagDisplayScope
)The page or pages on the online store where the script should be included.
-
src (
URL
)The URL of the remote script.
Return fields
-
scriptTag (
ScriptTag
)The script tag that was created.
-
userErrors (
[UserError!]!
)List of errors that occurred executing the mutation.