Skip to content

Knowledge Base Sync

Markopolo maintains a product knowledge base that powers features like campaigns, product recommendations, and catalog-based campaigns. This knowledge base is automatically kept in sync using the ViewItem event.

How It Works

Every time a ViewItem event fires with product data, Markopolo updates its knowledge base with the latest product information. This means:

  • Product details (name, price, images) stay current without manual catalog uploads
  • New products are automatically added when they're first viewed
  • Price changes and discounts are reflected in real time

ViewItem Is the Primary Source

The ViewItem event is the only event used to sync products with the knowledge base. Even if you send product data in other events like AddToCart or Purchase, that data is not used for catalog sync. Only ViewItem matters for keeping your product catalog up to date.

Why Complete Product Data Matters

You might be tempted to send minimal product data in your events — just an id and price, for example. While other events like AddToCart or Purchase can work fine with minimal product info, the ViewItem event should always include as much product detail as possible.

The data you send in ViewItem is what Markopolo uses to build and maintain your product catalog. This data feeds directly into Markopolo's AI-powered campaign content generation and product recommendations. Missing fields mean the knowledge base has incomplete information, which means:

  • Campaign content generated by Markopolo's AI may be inaccurate or generic
  • Dynamic ads may show outdated prices or missing images
  • Product recommendations lose relevance

Markopolo's AI is only as good as the context it has access to. The more complete your product data, the better the AI can generate compelling, accurate campaign content.

Technically, the only field required for a ViewItem event to be accepted is the product id — your event will go through even with minimal data. However, the more product information you provide, the better Markopolo's AI and campaigns will perform.

We highly recommend including all of the following fields in each product in the products array:

FieldImportanceDescription
idRequiredUnique identifier for the product. This is the key used to match and update products in the knowledge base
nameHighly RecommendedProduct name as you want it to appear in ads and recommendations
descriptionHighly RecommendedProduct description. Used in campaigns and AI-powered recommendations
priceHighly RecommendedOriginal price before any discount
image_urlHighly RecommendedURL of the product image. This is what appears in campaigns
urlHighly RecommendedURL of the product page. If not provided, the current browser URL is used — but it's best to provide it explicitly if your URLs contain tracking parameters or query strings that may change between visits
discountedRecommendedThe discounted price, if the product has a default/ongoing discount. Helps show accurate pricing in ads

Example

js
mtag("event", {
  type: "ViewItem",
  value: 49.99,
  currency: "USD",
  products: [
    {
      id: "SKU-345",
      name: "Classic Blue Oxford Shirt",
      description: "Men's classic fit oxford shirt in navy blue. 100% cotton, button-down collar.",
      price: 49.99,
      discounted: 39.99,
      image_url: "https://example.com/images/blue-oxford-shirt.jpg",
      url: "https://example.com/products/blue-oxford-shirt",
      category: "Apparel, Men's Shirts",
      variants: [
        {
          attributes: { size: "Large", color: "Blue" },
          price: { original: 49.99, discounted: 39.99, currency: "USD" },
          isAvailable: true
        }
      ],
    },
  ],
});

Best Practices

  1. Fire ViewItem on every product page — This is your catalog's lifeline. Every product page should trigger a ViewItem event with full product data.

  2. Always include id — Without a consistent product ID, Markopolo can't match incoming data to existing products. Use the same ID across all events (ViewItem, AddToCart, Purchase, etc.).

  3. Provide url explicitly — Don't rely on the browser URL fallback if your site uses tracking parameters (e.g. UTM tags, session IDs). These can create duplicate product entries. Pass the clean, canonical product URL instead.

  4. Keep image_url up to date — Product images are the most visible part of campaigns. Make sure the URL points to a high-quality, current image.

  5. Include discounted for sale items — If a product has an ongoing or default discount, include the discounted field so ads show the correct price customers will actually pay.

  6. Don't skip fields in ViewItem just because other events have them — Even if you send full product data in Purchase or AddToCart, that data doesn't sync to the knowledge base. Only ViewItem does.

Next Steps