Common Events

ShopMessage lets you control which events get fired and when, but there are certain reserved event names that require specufuc fields be present.

ViewProduct

attributetypedescription
product_idstring|numberrequired. your custom identifier for the product that the visitor viewed.
titlestringrequired. the title of the product that is viewed
product_urlstring (url)required. the fully-qualified URL of the product being viewed
vendorstringthe vendor of the product.
product_typestringthe type of product
product_tagsstring[]any set of tags that apply to this product
imagestring (url)required. the fully-qualified URL of an image for the product being viewed
_shopmsg('trigger', 'ViewProduct', {
  "product_id": 8257325317,
  "title": "Blue Shirt",
  "product_url": "https://bklyn-demo.myshopify.com/collections/mens/products/ayers-chambray",
  "vendor": "United By Blue",
  "product_type": "Mens",
  "product_tags": [
    "Shirts"
  ],
  "image": "https://cdn.shopify.com/s/files/1/2123/3399/products/chambray_5f232530-4331-492a-872c-81c225d6bafd.jpg?v=1498247863"
});

UpdateCart

attributetypedescription
total_pricenumberrequired. the total price of all of the items in the visitor's cart.
cta_urlstring (url)required. the destination you want your visitors to return to if they click and decide to resume shopping on your site.
itemsLineItem[]required. an array of items in the cart.

LineItem

attributetypedescription
titlestringrequired. the title of the product in the cart.
imagestring (url)required. the fully-qualified URL of the image of this line item.
pricenumberrequired. the price of the line item within the cart.
quantitynumberthe amount of this line item in the cart.
product_urlstring (url)required. the fully-qualified URL of the line item in the cart.
_shopmsg('trigger', 'UpdateCart', {
  "total_price": 29.99,
  "cta_url": "https://bklyn-demo.myshopify.com/cart/32659788101:1,32659610053:1",
  "items": [
    {
      "title": "Red Boot - 7",
      "image": "https://cdn.shopify.com/s/files/1/2123/3399/products/boot.jpg?v=1498247953",
      "price": 310.00,
      "quantity": 1,
      "product_url": "https://bklyn-demo.myshopify.com/products/redwing-iron-ranger?variant=32659788101"
    },
    {
      "title": "Blue Shirt - L",
      "image": "https://cdn.shopify.com/s/files/1/2123/3399/products/chambray_5f232530-4331-492a-872c-81c225d6bafd.jpg?v=1498247863",
      "price": 98.00,
      "quantity": 1,
      "product_url": "https://bklyn-demo.myshopify.com/products/ayers-chambray?variant=32659610053"
    }
  ]
});