Skip to main content

W3C Digital Data Layer by Fresh Relevance

Integrate and customize the W3C Digital Data Layer extension in your Magento ecommerce system with Fresh Relevance.

Updated yesterday

The W3C Digital Data Layer extension is the easiest way to integrate your Magento ecommerce system with Fresh Relevance. Once installed and set up, the Digital Data Layer (DDL) exposes product details in a standardized JavaScript object, allowing Fresh Relevance to capture them easily, generally with a lot less setup time than other ecommerce systems.


Set up your Digital Data Layer

  1. In Magento, go to Stores > Configuration.

  2. Under Digital Data Layer, select Digital Data Layer Settings to open the available extension settings.

  3. Set the Enable Digital Data Layer to Yes.


Customize the Digital Data Layer using extensions

Once you have enabled the Digital Data Layer, you can further customize it using the following extensions:

Expose Product Data On All Pages/Expose Product Data On These Pages

  • Expose Product Data On All Pages allows the Digital Data Layer to expose any products loaded on the page or a current cart the user may have on ALL pages. This can unnecessarily increase page load time on some pages.

  • Expose Product Data On These Pages allows you to select which pages to expose product details on. We recommend exposing on the following: Product Page, Basket Page, Checkout Page, and Checkout Success Page.

    When enabled on a page, this extension adds a JavaScript object to the global scope. To verify and inspect the available data:

    • Go to an enabled page on your store

    • Open your browser’s development tools.

    • Open the console, type digitalData and press enter.
      This action prints the data collected by the extension. In the following example, the customer has added one product to their cart.

Custom Purchase Complete Handling

  • You can expose the customer’s current transaction data on a page with custom layout handles. Input the layout handles in a CSV format to expose the transaction data where those handles are present.

Enable User Group Exposure

  • This extension allows you to expose the group a user belongs to, which may be useful if you display different content to multiple groups.

Enable Product Attributes

  • This extension lets you choose which product attributes are shown in the Digital Data Layer. Use the multi-select box to pick the attributes you want to display or hide.

Enable Stock Exposure

  • This extension allows you to choose the following settings:

    • Don’t Expose Stock - no stock information is included in your HTML.

    • Only Expose In or Out of stock - indicates whether it is in or out of stock

    • Expose Actual Stock Level - shows the exact number of items remaining in stock.

Product List Exposure Type

  • As product lists can significantly increase load time due to the large number of products, you can set the Product List Exposure Type to:

    • Simple - only uses the already loaded Product Information;

    • Full - fetches the Products from the database again to ensure we get all Product Data.

Linked Product Exposure

  • Enabling this includes linked product data for Configurable, Bundle and Grouped products. This is exposed in the linkedProduct property in a product’s data. For example, when on the product page for a configurable product.

Parent Product Exposure

  • Similar to Linked Product Exposure, this extension includes additional product data when enabled. While Linked Product Exposure contains the sub-products of a configurable, bundle, or grouped product, Parent Product Exposure includes the parent product(s). For example, the below is the data included for a product that is part of both a group product and a bundle product.

The extension has included the groupedParents and bundleParents properties.

Contact support for further assistance.

See also

Did this answer your question?