Track Product Arrays from Data Layer

Prev Next

If you have a product array in yourdataLayer, you can use the Product Array Mapper in the Smart Pixel Code Generator to easily submit the data to Smart Pixel. This guide will show you how to do this step-by-step.

Example Scenario

Let's consider a simple example where each product only consists of a name and a color. Your dataLayer could be defined like this:

window.dataLayer.products = [

	{name: "Product 1", color: "green"},

	{name: "Another Product", color: "red"}

];

Steps to map Product Arrays

  1. Enter the Product Array

    In the Product Mapper, enter the product array from your dataLayer. For this example, it would be window.dataLayer.products.

  2. Select the Smart Pixel Product Method

    Choose the Smart Pixel product method you want to use. In this case, we will use the "list" method.

  3. Map the Properties

    • ID Mapping: We want to use the name property as the id. Therefore, enter name in the field for ID mapping. You can use deeper paths like data.name, or if you prefer bracket notation, use ["name"].

    • Parameter Mapping: Map parameter 1 to the color key by entering color.

Smart Pixel Code Generator

Warning: 

Please be cautious when updating your data layer. The data layer is the source of analytical information for Mapp Intelligence. Changes may accidentally remove our tracking pixel, causing disruption and data loss. 

Any inconsistency will immediately impact data tracking quality. This means data won’t be available in reports, dashboards, or Engage.