Data Layer variables

Retail Rocket integration requires implementing of tracking codes into pages of the website. Each tracker must receive specific variable and must be executed in the specific event.

Here you can find the list of events and variables in Data Layer, which will allow you to integrate Retail Rocket.

What must contain the Data Layer?

📘

Type of integration

All variables that are described below, are related to Product API type of passing of product database, you don't need to create a XML-file for this type of integration.

All information about Data Layer you can find here.

Product page

Variables

For this page dataLayer must contain all variables which should be used in productsGroup.post tracking code.

  • categoryPaths (categoryPath must correspond to the main menu of the website) - mandatory, string;
  • description - mandatory, string;
  • groupId - mandatory, numerical;
  • stockId - optional, string;
  • vendor - optional, string;
  • products (parameters of product variants if it’s grouped product) - mandatory, numerical;
  • isAvailable (for each variant) - mandatory, boolean;
  • name (for each variant) - mandatory, string;
  • oldPrice (for each variant) - optional, numerical;
  • pictureUrl (for each variant) - mandatory, string;
  • price (for each variant) - mandatory, numerical;

Events

For this page dataLayer must contain events for 2 trackers - product page tracker and addToBasket tracker.

  • event of viewing of the product page;
  • event of adding product to the basket;

Category page

Variables

For this page dataLayer must contain all variables which should be used in categoryView tracking code.

  • categoryPath of the category in this format - mandatory, string (value of categoryPath must match value on the product page);
  • stockId - optional, string (for markup blocks on this page);

Events

For this page dataLayer must contain events for 1 tracker - categoryView tracking code.

  • event of viewing of categoryPage;

Search page

Variables

For search tracking code dataLayer must contain a variable of searchPhrase.

  • searchPhrase - mandatory, string;
  • stockId - optional, string (for markup blocks on this page);

Events

On the pages where the search is available - dataLayer must contain the event of entering the search phrase. With help of this event you will be able to execute tag with a searching tracker.

  • event of searching;

Cart page with products

Variables

On the cart page dataLayer must contain variables which will be passed to markup blocks on this page. It should be a list of product IDs that were added to the cart.

  • array of productIds - mandatory, array of integers;
  • stockId - optional, string (for markup blocks on this page);

Events

If it's necessary to replace the markup block for cart with products by markup block for empty cart - there should be an event of cart cleaning. With help of this event you will be able to replace the markup block by another one.

  • event of cart cleaning (if customer removes all products from cart);

Empty cart page

Variables

On the empty cart page it's necessary to pass only stockId for markup blocks.

  • stockId- optional, string (for markup blocks on this page);

Each page of the website

Variables

On every page dataLayer must contain stockId for markup blocks.

  • stockId - optional, string (for markup blocks on this page);

Each page with email-form

Variables

On every page that contains email form (registration / checkout / newsletter / popups), dataLayer must contain all necessary variables for subscribers parameters.

  • stockId - optional, string;
  • email address - mandatory, string;
  • ID of the customer in your system - mandatory, string;
  • any other variables related to the customer information;

Events

On such pages dataLayer must contain an event for the methods that allow to collect email addresses. If a customer enters his email, fills the whole form and clicks on “submit” / “subscribe”.

  • event of “subscription” (registration/login/etc);

Checkout page

Variables

Checkout page must contain all required parameters for the transaction tracking code.

  • product ID - mandatory, string (for each product in order);
  • product price - mandatory, string (for each product in order);
  • product quantity - mandatory, string (for each product in order);

Events

Checkout dataLayer must contain the event of purchasing.

  • event of purchasing;

Favorites page with products

Variables

On the favorites page dataLayer must contain variables which will be passed to markup blocks on this page. It should be a list of product IDs that were added to the favorites list.

  • array of productIds - mandatory, array of integers;
  • stockId - optional, string (for markup blocks on this page);

Events

If it's necessary to replace the markup block for favorites page with products by markup block for empty favorites page - there should be an event of products list cleaning. With help of this event you will be able to replace the markup block by another one.

  • event of the list cleaning (if customer removes all products from the list);