All Collections
Drips
Custom Events
Product Viewed Event - Custom Platforms
Product Viewed Event - Custom Platforms
Updated over a week ago

Today more than ever, customers expect messaging specific to their individual experience. To achieve this, it is possible to use dynamic variables within messages in the Product Viewed flow.


Required Properties

If you would like to utilize the Product Viewed trigger event you will need Open Graph or custom metatags included in the header of each product page. Shopify includes these by default within your template, but for other custom platforms and some custom Shopify templates the following properties are required:

  • Type: "og:type"

    • "product" value required.

  • Product Title: "og:title"

  • Product URL: "og:url"

  • Product Image: "og:image"

  • Product Price Amount: "og:price:amount" or "product:price:amount"

  • Product Price Currency: "og:price:currency" or "product:price:currency"

Examples


Testing Meta Tags

You can test if your meta tags are properly enabled on your site by running the following code in your browser's dev console:

/** Retrieves the property by name */function getMetaPropertyContent(propertyValue, attrValue) {  var ele = document.querySelector('meta[property="' + propertyValue + '"]');  if (!ele) return '';  var value = ele.getAttribute(attrValue || "content")  return value || '';}/** Logs the properties for viewing */console.log(JSON.stringify(Object.fromEntries([ 'og:type', 'og:title', 'og:url', 'og:image', 'product:price:amount', 'product:price:currency' ].map((key) => [key, getMetaPropertyContent(key)])), null, 2));

Here is an example of what you should see after running the code:

undefined


Alternative JavaScript Implementation

If modifying meta tags is not the route you wish to take, you may execute the following JavaScript on product page load to trigger a Product Viewed event:

Note: The Voyage Global Tag must be included on the page and loaded prior to making the event call.


Tags Missing in Shopify Theme

If the tags are not showing up, place the following code in the theme.liquid file between the

tags to dynamically populate the tags on product pages:
โ€‹

{% if template contains 'product' %}{% endif %}


Tags Missing in BigCommerce Theme

If you have any additional questions please contact us at [email protected].

Did this answer your question?