ScriptTag

Version 2019-10

The ScriptTag resource represents remote JavaScript code that is loaded into the pages of a shop's storefront or the order status page of checkout. This lets you add functionality to those pages without using theme templates.

Script tags are scoped to the app that created them. When an app is uninstalled from a shop, all of the script tags that it created are automatically removed along with it.

What you can do with ScriptTag

The Shopify API lets you do the following with the ScriptTag resource. More detailed versions of these general actions may be available:

ScriptTag properties

created_at
read-only
"created_at": "2012-08-24T14:01:47-04:00"

The date and time (ISO 8601) when the script tag was created.

event
required
"event": "onload"

The DOM event that triggers the loading of the script. Valid values: onload.

id
read-only
"id": 596726825

The ID for the script tag.

src
required
"src": "https://js-aplenty.com/foo.js"

The URL of the remote script.

display_scope
"display_scope": "online_store"

The page or pages on the online store where the script should be included. Valid values:

  • online_store: Include the script only on the web storefront.
  • order_status: Include the script only on the order status page.
  • all: Include the script on both the web storefront and the order status page.

updated_at
read-only
"updated_at"