Pages

A product is a good or service offered to visitors on a site.

Product tracking comprises:

  • Collecting product data from a website and storing the data in a product database.
  • Counting the number of views different products receive from visitors.

You can use product views for implementing product recommendations and visitor segmentation. For example, you can recommend products that visitors view often, or you can segment visitors based on the types of products they have viewed.

Tracking products with the data layer means triggering a product view event whenever a visitor navigates to a product page or otherwise views a product on the site.

The Frosmo data layer supports the product object for triggering product view events.

For a product tracking example that uses the data layer from a modification, see Example: Recommending products purchased together.

Triggering product view events

To trigger a product view event, call dataLayer.push() with a product object:

{
    frosmoProductId: 'string',
    /* Optional */
    frosmoProductCategory: 'string',
    frosmoProductData: {},
    frosmoProductDiscountPrice: 0,
    frosmoProductImage: 'string',
    frosmoProductName: 'string',
    frosmoProductPrice: 0,
    frosmoProductPromotionLabel: 'string',
    frosmoProductUrl: 'string'
    /* ... */
}

The call triggers the event and sends the product data to the Frosmo back end. By default, the platform registers the data push as a single view for the product, incrementing the product view count by one.

If the product is already in the database, the product data is updated in case the new data from the call differs from the existing data. The product view count is incremented regardless of whether the product data is updated.

Product object

The product object describes a product. The object properties together define the product data.

Table: Product object properties

PropertyDescriptionTypeRole
frosmoProductIdProduct ID.String (128)Required
frosmoProductArea

Geographical region, typically a part of a country, that applies to the product in some way.

For example, if the product is a hotel room, this property can provide the name of the in-country region in which the hotel is located:

  • frosmoProductCountry: Greece
  • frosmoProductArea: Rhodes
  • frosmoProductCity: Lindos
String (32)Optional
frosmoProductCampaignSales or other campaign with which the product is associated.String (32)Optional
frosmoProductCategories

Additional product categories to which the product belongs.

For more information about the object type, see the instructions below this table.

Object or stringified object (1024)Optional
frosmoProductCategory

Product type.

Even if you do not have a value for this property, it is recommended that you nonetheless pass an empty string.

String (128)Optional
frosmoProductCity

City or town that applies to the product in some way.

For example, if the product is a hotel room, this property provides the name of the city or town in which the hotel is located:

  • frosmoProductCountry: Greece
  • frosmoProductArea: Rhodes
  • frosmoProductCity: Lindos
String (32)Optional
frosmoProductColors

Color options for the product.

For more information about the object type, see the instructions below this table.

Object or stringified object (1024)Optional
frosmoProductCompanyCompany that offers the product.String (32)Optional
frosmoProductConversion

If you do not want the product data push to increment the view count for the product, set this property to 1. In this case, the Frosmo Platform merely stores the pushed product data.

The default value is 0, which means that the Frosmo Platform also registers the product data push as a product view.

Despite the name, this property does not trigger a conversion event for the product, regardless of the property value. If you want to trigger a conversion event for the product, use a conversion or transaction object, depending on whether the conversion is a product purchase.

NumberOptional
frosmoProductCountry

Country that applies to the product in some way.

For example, if the product is a hotel room, this property provides the name of the country in which the hotel is located:

  • frosmoProductCountry: Greece
  • frosmoProductArea: Rhodes
  • frosmoProductCity: Lindos
String (32)Optional
frosmoProductCustomImages

URLs of additional product images.

For more information about the object type, see the instructions below this table.

Object or stringified object (1024)Optional
frosmoProductData

Any piece of product data that does not logically belong to the other product properties but that you want to push with the product data. Use this property to send your own custom product attributes along with the product data.

For more information about the object type, see the instructions below this table.

Object or stringified object (2048)Optional
frosmoProductDescriptionProduct description.String (512)Optional
frosmoProductDiscountPriceDiscount unit price for the product.NumberOptional
frosmoProductIds

Additional product IDs.

For example, if the product consists of multiple child products, you can add their IDs to this property.

For more information about the object type, see the instructions below this table.

Object or stringified object (1024)Optional
frosmoProductImage

Product image URL.

Even if you do not have a value for this property, it is recommended that you nonetheless pass an empty string.

String (512)Optional
frosmoProductMainCategoryMain product category to which the product belongs.String (128)Optional
frosmoProductManufacturerCompany that produces the product, or the brand name for the product.String (512)Optional
frosmoProductModelProduct model name.String (32)Optional
frosmoProductMultiPrices

Additional unit price options for the product.

For more information about the object type, see the instructions below this table.

Object or stringified object (2048)Optional
frosmoProductName

Product name.

Even if you do not have a value for this property, it is recommended that you nonetheless pass an empty string.

String (128)Optional
frosmoProductPrice

Unit price for the product.

Even if you do not have a value for this property, it is recommended that you nonetheless pass an empty string.

NumberOptional
frosmoProductPromotionLabel

Promotion-related label, such as "Weekend Sale" or "80% off!".

This property is intended for promotion-related label strings. Do not use this property for stringified objects. If you need to store extra product data beyond the standard product data properties listed here, use the frosmoProductData property.

String (512)Optional
frosmoProductRatingProduct rating.String (512)Optional
frosmoProductStockNumber of product units in stock.NumberOptional
frosmoProductSubCategorySubcategory to which the product belongs. The subcategory should be a child category of the main product category.String (128)Optional
frosmoProductUrl

Product page URL.

Even if you do not have a value for this property, it is recommended that you nonetheless pass an empty string.

String (512)Optional
frosmoProductUrnUniform Resource Names (URN) for the product.String (32)Optional
frosmoProductVenue

Venue in which the product is available.

For example, if the product is a specific showing of a movie, this property would be the movie theater in which the movie is shown.

String (64)Optional

Objects

Follow these rules for properties whose type is listed as "Object":

  • The value can be either a JavaScript object or a JSON-stringified object. In the latter case, the maximum length of the string is either 1024 or 2048 characters, depending on the property (see above).
  • The object properties can be anything you want them to be. The Frosmo back end does not validate the properties against any data model or schema.

If you assign a JavaScript object to a property, the Frosmo back end stringifies the value. If you assign a stringified object to a property, the value is used as-is.

Examples

Example: Triggering a product view event with a simple product object
dataLayer.push({
    frosmoProductId: '123456',
    frosmoProductCategory: 'Plushies',
    frosmoProductDiscountPrice: 9.99,
    frosmoProductImage: 'http://webshop.com/images/cheetah_plushy.png',
    frosmoProductName: 'Cheetah Plushy',
    frosmoProductPrice: 19.99,
    frosmoProductPromotionLabel: 'Weekend Sale',
    frosmoProductUrl: 'http://webshop.com/products/123456'
});
Example: Triggering a product view event with a product object containing an object property
dataLayer.push({
    frosmoProductId: '123456',
    frosmoProductCategory: 'Plushies',
    frosmoProductDiscountPrice: 9.99,
    frosmoProductImage: 'http://webshop.com/images/cheetah_plushy.png',
    frosmoProductName: 'Cheetah Plushy',
    frosmoProductPrice: 19.99,
    frosmoProductPromotionLabel: 'Weekend Sale',
    frosmoProductUrl: 'http://webshop.com/products/123456',
    frosmoProductColors: {
        black: '#000000',
        blue: '#0000ff',
        lime: '#00ff00',
        red: '#ff0000'
    }
});
  • No labels