Key Takeaways from a Shopify Sitemap

In March I completed development of two sitemaps for a retail company involving four domains and two Shopify stores in one dataset. Here are my key takeaways from the build:

  • Shopify does not allow shops to be served in an iframe, and the default behaviour for all storefront requests is to send the X-Frame-Options = DENY header. This meant the Visual Editor was blocked from loading on collection pages, product pages, and checkout. Luckily the customer had multiple domains with Personalization enabled, so I was able to open the Visual Editor on domain A to create the sitemaps for domains B & C (the Shopify stores).
  • Click every product in a store to ensure that Related Catalog Object data is captured correctly in the MCP event stream and on the product
  • Add brand name in front of categories to create a neat category hierarchy in MCP
interaction: {
    name: SalesforceInteractions.CatalogObjectInteractionName.ViewCatalogObject,
    catalogObject: {
        type: "Category",
        id: () => {if (is_data) { return "brand|"+is_data.categories[0].replace(/\s+/g, '').toLowerCase(); }}
    }
}
  • When a dataset has products across multiple brands, and you want to recommend products from one brand only, avoid using “trending fallback” in recipes. This option ignores exclusions, and therefore brand RCO inclusions.

Recommendations

Cart recommendations were a particular challenge. A product feed sent a unique ID for products to the Personalization Catalog. However, this ID was shared across Shopify stores, and each store had its own Shopify ID per product. With every View Item event, the product data in MCP would switch between Store A/Store B because there’s only one product in the MCP Catalog, but two Shopify versions. When testing recommendations, if the Shopify ID returned in the payload was for the other store, the product couldn’t be added to cart.

Solution: capture “Store A Shopify ID” and “Store B Shopify ID” as separate attributes on the product in MCP via the sitemap. These attributes can be made available in the payload of web campaigns. A Shopify developer selects the correct Shopify ID and renders the recommended product for the store being viewed.