e-comm: Product Viewed

The "Product Viewed" event forms the top of the e-commerce funnel in many Adobe Analytics implementations. It is typically sent when the user is viewing details about a product. For Adobe Analytics we must set (at a minimum) the prodView event, and a single productID in s.products.

Overview

Starting with this event that the application pushes to the data layer (window.appEventData in this case)...

window.appEventData = window.appEventData || [];
window.appEventData.push({
  "event": "Product Viewed",
  "product": [
    {
      "productInfo": {
        "productID": "HC30ABJ786"
      }
    }
  ]
});

...we will create a rule in Launch that will build and send a beacon to record the event Adobe Analytics. The steps that we will detail are:

  1. Create a rule triggered by the Data Layer Manager : Data Layer Push for "Product Viewed"

  2. Add an Adobe Analytics Action to set prodView and event21 in the events string.

  3. Add an AA Product String Builder Action to set the product string Category and ProductID fields.

  4. Add an Adobe Analytics Action to Send a Beacon

  5. Test this event in the browser console.

After all is said and done, our rule will look like this:

Step 1 - Event Trigger: Data Layer Push - Product Viewed

The event that triggers our rule is provided by the Data Layer Manager extension. Select from the options or type in "Product Viewed" for Event Name. We get this value from the event key in the data layer push code shown above.

Step 2 - Adobe Analytics - Set Vars

Using the Adobe Analytics extension's Set Variables action, we set prodView and event21 (our AA Custom event for reporting outside of "products").

Step 3 - AA Product String Builder - Set Variables

This action works in concert with the Adobe Analytics Set Variables action. For this simple case we only need to set four values.

  1. Root Data Object - Here we are using %Data Layer Root% which is a Context Aware Data Element provided by the Data Layer Manager. It returns a JSON object that represents the current state of the data layer (including events that may have been pushed prior).

  2. Product Collection Path - This tells the Product String Builder how to find the product collection. A product Collection is an Array of objects containing product information.

  3. Category - This populates the first part of the product string. Setting it to "product" is one way of telling Adobe Analytics that this is a "real product". In advanced scenarios we use the product string to represent things like "payments" or "shipments" (and set the Category value accordingly).

  4. Product ID - This is the unique identifier of the product that is being viewed. In this example, the path within the product collection to the Product ID is productInfo.productID.

Step 4 - Adobe Analytics - Send Beacon

This step is pretty basic, but included here to be complete. We are using a Custom Link beacon here and setting the Link Name to "Product Viewed". There is nothing special about this; use any value that you like.

Step 5 - Testing in the console

We can do an end-to-end test of this rule by building our changes into the development environment, and manually pushing the event object onto our data layer. In the image below, the Adobe Analytics Server call info is provided by a free Chrome plug-in called Debugger for Adobe Analytics.

Last updated