Shopify Store

The Dynamic Yield Shopify app enables you to quickly implement Dynamic Yield on your Shopify website. The Dynamic Yield app sets up:

When you implement Dynamic Yield with the plugin, you can't change the events, script, context, and cookie consent implementation. These are standardized and managed by the app. If, for any reason, you want more control over these aspects of the implementation, consider not implementing Dynamic Yield with the app.

The app is compatible with every version and every theme of Shopify Online (web stores only).

Configure the app

First, install the Dynamic Yield app from your Shopify store:
https://apps.shopify.com/dynamic-yield-v2

Now, on the app page, implement Dynamic Yield on your site:

  1. Paste your Dynamic Yield section ID. The section ID is a 7-digit number that appears in the URL of any page in the Dynamic Yield console, starting with 8 or 9.
  2. Enable DY Embed Block in your theme.

That’s it. Now, the Dynamic Yield script and page context run on every page of your store, and e-commerce events are fired when users make purchases, add products to the cart, and so on.

Scripts on checkout

Scripts are not deployed on the checkout page with the DY Shopify App due to Shopify restrictions relating to users entering payment-sensitive information. This means that the Purchase event is fired by the DY Shopify App from the confirmation page (after checkout).

New Checkout Extensibility

The newest Shopify Checkout Extensibility doesn't allow you to directly inject scripts on the Thank you page, so purchase events can't fire. To check whether your site is on the latest Checkout Extensibility, go to Settings › Checkout. You'll see the following message:

To solve the purchase event issue, we have introduced purchase events within the Shopify web pixels, which send purchase events using a client-side API. To enable this method, enter your Experience API client-side key in the advanced settings:

Custom storefront

If you are using a custom Shopify storefront like Hydrogen, the DY plugin will only be responsible for product catalog sync. Everything else related to Dynamic Yield implementation, such as scripts, context, events, and so on, you must implement on your own. Dynamic Yield can be implemented on custom storefronts using 2 methods: client-side scripts and APIs, or server-side APIs.

If you want to implement client-side scripts and your custom storefront also leverages the Content Security Policy, don't forget to add to your allow list content coming from the Dynamic Yield domain: *.dynamicyield.com

Consent to cookies

Active Cookie Consent means you can serve personalized experiences to those customers who indicated that they consent to cookies (and non-personalized experiences to those who did not actively consent). The app automatically runs the code snippet that's required to indicate Active Cookie Consent. The consent status is not managed by the app or by Dynamic Yield. The app reads it directly from the Shopify native Customer API.

Sync your product catalog with Dynamic Yield

A synced product feed enables capabilities like recommendations, segmenting based on product engagement, social proof tactics, and more.

To enable the sync, you must enter the AWS S3 access and secret keys. To get these credentials:

  1. Go to the Experience OS console.
  2. Click Assets, and then click Data Feeds.
  3. Click Add New to create a new Product Feed. If you already have a Product Feed, you'll need to edit it.
  4. In the Feed Source, select Sync a file via Amazon S3.
  1. Click Create a bucket. The Access Key and Secret Key are displayed.
  2. Copy these credentials and paste them into the Shopify App configuration:
  1. Click Sync Entire Catalog Now. From now on, the feed will be synced every 6 hours.

Product feed columns

You can choose what to sync to Dynamic Yield. You can use the product attributes you sync in translations, rules in recommendation strategies, targeting based on engagement with these product attributes, and more. You can decide if you want to sync the following:

  • The mandatory column, as well as descriptions and keywords:
Product Feed ColumnShopify Attribute (Recommended)
skuVariant ID
group_idProduct ID
nameTitle
urlOnline store URL
image_urlFeatured image URL
priceVariant price
categoriesA list of all product collection names
in_stockVariant availability
descriptionDescription
keywordsA list of all product tags
  • Custom: You decide which columns to onboard. In this mode, you must provide JavaScript code to transform any information from the Shopify Product Object into a flat CSV that is generated periodically and synced with Dynamic Yield. While you input the code, you can click Download Preview File to see the result of your code in JSON format. Click the gear icon or select the product ID to preview the parsing on a specific product.
Shopify object values

You can use this schema that exists in Shopify's object (product object, variant object, and collection object) or download a JSON example with product data. See below the full list of product attributes you can use:

products[{

  id

  status

  title

  description

  handle

  onlineStorePreviewUrl

  onlineStoreUrl

  hasOnlyDefaultVariant

  hasOutOfStockVariants

  giftCardTemplateSuffix

  publishedAt

  requiresSellingPlan

  totalInventory

  totalVariants

  tracksInventory

  updatedAt

  vendor

  isGiftCard

  productType

  tags

  product_ {

    lng_code

  } [{

    locale

    key

    value

    regions[]

  }]

  featuredImage {
    id
    altText
    url
  }
  images(first: 50)[{
    id
    altText
    url
  }]
  options[{
    name
    position
    values
    option_ {
      lng_code
    } [{
      locale
      key
      value
    }]
  }]
  collections(first: 50, query: "published_status:published")[{
    id
    title
    handle
    image {
      id
      url
      altText
    }
    description
    productsCount
    collection_ {
      lng_code
    } [{
      locale
      key
      value
      regions[]
    }]
  }]
  variants[{
    id
    title
    displayName
    availableForSale
    price
    sku
    taxable
    taxCode
    weight
    weightUnit
    compareAtPrice
    inventoryQuantity
    sellableOnlineQuantity
    position
    image {
      url
      altText
    }
    selectedOptions[{
      name
      value
    }]
    variant_ {
      lng_code
    } [{
      locale
      key
      value
      regions[]
    }]
  }]
  metafields[{
    namespace
    value
    description
    type
    key
  }]
}]
Product example (JSON)
[
  {
    "product_id": "6839877959749",
    "variants": [
      {
        "id": "gid://shopify/ProductVariant/40391092043845",
        "__typename": "ProductVariant",
        "title": "4 Outlet/2 USB",
        "displayName": "6-Outlet Smart Extension Cord, Surge Protector and Cord Extender, 3 ft. - 4 Outlet/2 USB",
        "availableForSale": true,
        "price": "34.99",
        "sku": "GN-SW023-199S",
        "taxable": true,
        "taxCode": "",
        "weight": 0.99,
        "weightUnit": "POUNDS",
        "compareAtPrice": "0.00",
        "inventoryQuantity": 65,
        "sellableOnlineQuantity": 65,
        "position": 3,
        "image": {
          "url": "https://cdn.shopify.com/s/files/1/0564/7007/7509/products/SW023.main-3.jpg?v=1666051727",
          "altText": null
        },
        "selectedOptions": [
          {
            "name": "Size",
            "value": "4 Outlet/2 USB"
          }
        ],
        "variant_fr": [
          {
            "locale": "fr",
            "key": "option1",
            "value": "4 prises/2 USB",
            "regions": [
              "US",
              "FR",
              "IT",
              "ES"
            ]
          }
        ],
        "variant_ru": [
          {
            "locale": "ru",
            "key": "option1",
            "value": "4 выхода/2 USB",
            "regions": [
              "US",
              "FR"
            ]
          }
        ],
        "__parentId": "gid://shopify/Product/6839877959749"
      },
      {
        "id": "gid://shopify/ProductVariant/40391092011077",
        "__typename": "ProductVariant",
        "title": "3 Outlet",
        "displayName": "6-Outlet Smart Extension Cord, Surge Protector and Cord Extender, 3 ft. - 3 Outlet",
        "availableForSale": false,
        "price": "24.99",
        "sku": "GN-SW004-199S",
        "taxable": true,
        "taxCode": "",
        "weight": 0.8937,
        "weightUnit": "POUNDS",
        "compareAtPrice": "0.00",
        "inventoryQuantity": 0,
        "sellableOnlineQuantity": 0,
        "position": 2,
        "image": {
          "url": "https://cdn.shopify.com/s/files/1/0564/7007/7509/products/SW004.main-3.jpg?v=1666051727",
          "altText": null
        },
        "selectedOptions": [
          {
            "name": "Size",
            "value": "3 Outlet"
          }
        ],
        "variant_fr": [
          {
            "locale": "fr",
            "key": "option1",
            "value": "3 sorties",
            "regions": [
              "US",
              "FR",
              "IT",
              "ES"
            ]
          }
        ],
        "variant_ru": [
          {
            "locale": "ru",
            "key": "option1",
            "value": "3 Розетка",
            "regions": [
              "US",
              "FR"
            ]
          }
        ],
        "__parentId": "gid://shopify/Product/6839877959749"
      },
      {
        "id": "gid://shopify/ProductVariant/40391091978309",
        "__typename": "ProductVariant",
        "title": "6 Outlet",
        "displayName": "6-Outlet Smart Extension Cord, Surge Protector and Cord Extender, 3 ft. - 6 Outlet",
        "availableForSale": false,
        "price": "29.99",
        "sku": "GN-SW003-199S",
        "taxable": true,
        "taxCode": "",
        "weight": 0.99,
        "weightUnit": "POUNDS",
        "compareAtPrice": "0.00",
        "inventoryQuantity": 0,
        "sellableOnlineQuantity": 0,
        "position": 1,
        "image": {
          "url": "https://cdn.shopify.com/s/files/1/0564/7007/7509/products/GN-SW003.main-3.jpg?v=1666051727",
          "altText": null
        },
        "selectedOptions": [
          {
            "name": "Size",
            "value": "6 Outlet"
          }
        ],
        "variant_fr": [
          {
            "locale": "fr",
            "key": "option1",
            "value": "6 Prise",
            "regions": [
              "US",
              "FR",
              "IT",
              "ES"
            ]
          }
        ],
        "variant_ru": [
          {
            "locale": "ru",
            "key": "option1",
            "value": "6 Розетка",
            "regions": [
              "US",
              "FR"
            ]
          }
        ],
        "__parentId": "gid://shopify/Product/6839877959749"
      }
    ],
    "collections": [
      {
        "__typename": "Collection",
        "id": "gid://shopify/Collection/266954080325",
        "title": "Home page",
        "handle": "frontpage",
        "image": null,
        "description": "Some home page collection description.",
        "productsCount": 2,
        "collection_fr": [
          {
            "locale": "fr",
            "key": "body_html",
            "value": "Une description de la collection de la page d'accueil.",
            "regions": [
              "US",
              "FR",
              "IT",
              "ES"
            ]
          },
          {
            "locale": "fr",
            "key": "title",
            "value": "Page d'accueil",
            "regions": [
              "US",
              "FR",
              "IT",
              "ES"
            ]
          }
        ],
        "collection_ru": [
          {
            "locale": "ru",
            "key": "body_html",
            "value": "Некоторое описание коллекции домашней страницы.",
            "regions": [
              "US",
              "FR"
            ]
          },
          {
            "locale": "ru",
            "key": "title",
            "value": "Домашняя страница",
            "regions": [
              "US",
              "FR"
            ]
          }
        ],
        "__parentId": "gid://shopify/Product/6839877959749"
      }
    ],
    "images": [
      {
        "url": "https://cdn.shopify.com/s/files/1/0564/7007/7509/products/SW023.main-3.jpg?v=1666051727",
        "altText": ""
      },
      {
        "url": "https://cdn.shopify.com/s/files/1/0564/7007/7509/products/SW004.main-3.jpg?v=1666051727",
        "altText": ""
      },
      {
        "url": "https://cdn.shopify.com/s/files/1/0564/7007/7509/products/GN-SW003.main-3.jpg?v=1666051727",
        "altText": ""
      }
    ],
    "metafields": [
      {
        "namespace": "custom",
        "key": "image",
        "value": "gid://shopify/MediaImage/25073478107205",
        "type": "file_reference",
        "description": null
      },
      {
        "namespace": "shopify--discovery--product_recommendation",
        "key": "related_products",
        "value": "[\"gid://shopify/Product/6832727031877\"]",
        "type": "list.product_reference",
        "description": null
      },
      {
        "namespace": "descriptors",
        "key": "subtitle",
        "value": "dy Smart Extension Cord Surge Protector",
        "type": "single_line_text_field",
        "description": null
      },
      {
        "namespace": "global",
        "key": "description_tag",
        "value": "Independently control each outlet from your smart phone using the dy app (iOS and Android compatible). Pair with Amazon Alexa or Google assistant so you can control your electronics with just the power of your voice. 6 outlets, 460 joules surge protected, 125V, 3 ft. cable. No hub required.",
        "type": "string",
        "description": "Description of the product for search engines"
      },
      {
        "namespace": "global",
        "key": "title_tag",
        "value": "dy Smart Extension Cord Surge Protector, 3 ft.",
        "type": "string",
        "description": "Title of the product for search engines"
      }
    ],
    "__typename": "Product",
    "id": "6839877959749",
    "status": "ACTIVE",
    "title": "6-Outlet Smart Extension Cord, Surge Protector and Cord Extender, 3 ft.",
    "description": "Independently control each outlet from your smart phone using the dy app (iOS and Android compatible). Pair with Amazon Alexa or Google assistant so you can control your electronics with just the power of your voice.",
    "handle": "dy-gn-sw003-199-surge-smart-protector-white",
    "onlineStorePreviewUrl": "https://dyapp-testing-on-plus-store.myshopify.com/products/dy-gn-sw003-199-surge-smart-protector-white",
    "onlineStoreUrl": null,
    "hasOnlyDefaultVariant": false,
    "hasOutOfStockVariants": true,
    "giftCardTemplateSuffix": "",
    "publishedAt": "2022-10-18T00:08:42Z",
    "requiresSellingPlan": false,
    "totalInventory": 65,
    "totalVariants": 3,
    "tracksInventory": true,
    "updatedAt": "2023-05-06T00:26:31Z",
    "vendor": "Dynamic Yield",
    "isGiftCard": false,
    "productType": "Smarthome",
    "tags": [
      "home-improvement",
      "track"
    ],
    "product_fr": [
      {
        "locale": "fr",
        "key": "body_html",
        "value": "<p><span data-mce-fragment=\"1\">Contrôlez indépendamment chaque prise depuis votre smartphone grâce à l'application dy (compatible iOS et Android). Associez-le à Amazon Alexa ou à l'assistant Google pour pouvoir contrôler vos appareils électroniques avec la seule puissance de votre voix.</span></p><ul class=\"a-unordered-list a-vertical a-spacing-mini\"></ul>",
        "regions": [
          "US",
          "FR",
          "IT",
          "ES"
        ]
      },
      {
        "locale": "fr",
        "key": "meta_description",
        "value": "Contrôlez indépendamment chaque prise depuis votre smartphone grâce à l'application dy (compatible iOS et Android). Associez-le à Amazon Alexa ou à l'assistant Google pour pouvoir contrôler vos appareils électroniques avec la seule puissance de votre voix. 6 prises, 460 joules protégées contre les surtensions, 125 V, câble de 3 pi. Aucun concentrateur requis.",
        "regions": [
          "US",
          "FR",
          "IT",
          "ES"
        ]
      },
      {
        "locale": "fr",
        "key": "meta_title",
        "value": "Protection contre les surtensions pour cordon d'extension dy Smart, 3 pi",
        "regions": [
          "US",
          "FR",
          "IT",
          "ES"
        ]
      },
      {
        "locale": "fr",
        "key": "title",
        "value": "Rallonge intelligente à 6 prises, parasurtenseur et prolongateur de cordon, 3 pi",
        "regions": [
          "US",
          "FR",
          "IT",
          "ES"
        ]
      }
    ],
    "product_ru": [
      {
        "locale": "ru",
        "key": "body_html",
        "value": "<meta charset=\"utf-8\">\n<p data-mce-fragment=\"1\">Независимо управляйте каждой розеткой со своего смартфона с помощью приложения dy (совместимо с iOS и Android). Подключитесь к Amazon Alexa или помощнику Google, чтобы управлять своей электроникой силой голоса.</p>\n<ul class=\"a-unordered-list a-vertical a-spacing-mini\" data-mce-fragment=\"1\"></ul>",
        "regions": [
          "US",
          "FR"
        ]
      },
      {
        "locale": "ru",
        "key": "meta_description",
        "value": "Независимо управляйте каждой розеткой со своего смартфона с помощью приложения dy (совместимо с iOS и Android). Подключитесь к Amazon Alexa или помощнику Google, чтобы управлять своей электроникой силой голоса. 6 розеток, защита от перенапряжения 460 Дж, 125 В, кабель 3 фута. Концентратор не требуется.",
        "regions": [
          "US",
          "FR"
        ]
      },
      {
        "locale": "ru",
        "key": "meta_title",
        "value": "Устройство защиты от перенапряжений dy Smart Extension Cord, 3 фута.",
        "regions": [
          "US",
          "FR"
        ]
      },
      {
        "locale": "ru",
        "key": "title",
        "value": "Умный удлинитель на 6 розеток, устройство защиты от перенапряжения и удлинитель шнура, 3 фута.",
        "regions": [
          "US",
          "FR"
        ]
      }
    ],
    "featuredImage": {
      "id": "gid://shopify/ProductImage/31953792860229",
      "altText": null,
      "url": "https://cdn.shopify.com/s/files/1/0564/7007/7509/products/GN-SW003.main-3.jpg?v=1666051727"
    },
    "options": [
      {
        "name": "Size",
        "position": 1,
        "values": [
          "6 Outlet",
          "3 Outlet",
          "4 Outlet/2 USB"
        ],
        "option_fr": [
          {
            "locale": "fr",
            "key": "name",
            "value": "Taille"
          }
        ],
        "option_ru": [
          {
            "locale": "ru",
            "key": "name",
            "value": "Размер"
          }
        ]
      }
    ]
  }
]