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

attribute

type

description

product_id

string|number

required. your custom identifier for the product that the visitor viewed.

title

string

required. the title of the product that is viewed

product_url

string (url)

required. the fully-qualified URL of the product being viewed

vendor

string

the vendor of the product.

product_type

string

the type of product

product_tags

string[]

any set of tags that apply to this product

image

string (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

attribute

type

description

total_price

number

required. the total price of all of the items in the visitor's cart.

cta_url

string (url)

required. the destination you want your visitors to return to if they click and decide to resume shopping on your site.

items

LineItem[]

required. an array of items in the cart.

LineItem

attribute

type

description

title

string

required. the title of the product in the cart.

image

string (url)

required. the fully-qualified URL of the image of this line item.

price

number

required. the price of the line item within the cart.

quantity

number

the amount of this line item in the cart.

product_url

string (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"
    }
  ]
});