How to enable Merchandising Reporting

Merchandising reporting lets you track the performance of your strategies (views, clicks, conversions) directly in Google Analytics 4 (GA4). To do this, you just need to make sure that Merch events are sent to your website’s DataLayer through the AB Tasty tag.

Enabling Merchandising reporting

1

Check that the AB Tasty tag is installed

If you already have product recommendations running on your site, the tag is already there — no extra setup required.

2

Configure analytics in your tag

Your Technical Support Engineer (TSE) or internal tech team simply needs to add this key to the config.json file of your tag configuration:

"analytics": {
  "merchandisingEventsToDataLayer": ["site"]
}

This automatically enables Merchandising events (show, click, add_to_cart, convert) to be pushed into your site’s DataLayer - exactly like Recommendation events.

3

Make sure GA4 / GTM is set up

If your Recommendation reporting is already configured, Merch events will be captured the same way. Otherwise, your TSE or internal tech team can follow the existing Recos GTM setup (same trigger, variables, and event structure).

4

Test it

Open your site → open the browser console → type dataLayer. You should see events like:

{
  "event": "ab_recos_xxxx",
  "recos": {
    "action_id": "show",
    "reco_id": "xxxx",
    "item_ids": "[\"12345\",\"67890\"]"
  }
}

If you see them, it means Merch events are being correctly sent to GA4.

If you want to know more about the Merchandising strategy reporting dashboard with metrics like views, clicks, conversion rate, and top products, read Merchandising Reporting

Need help?

Contact your Technical Success Engineer (TSE) to confirm or validate the configuration.

How to setup HTML on your website ?

To allow the AB Tasty tag to detect and send Merch events automatically, your merchandising banners must include specific HTML attributes.

If AB Tasty does not manage your frontend (custom site or CMS), your development team must add these attributes directly in the HTML of your merchandising banners. Each product container should include these attributes so the AB Tasty tag can detect and send events.

Required attributes

Attribute
Description
Example

data-category-id

Category identifier

<div data-category-id="jeans-homme">

data-item-id

Product identifier

<div data-item-id="SKU123">

data-reco-click

User interaction type

<button data-reco-click="add_to_cart_item">

data-reco-debug="true" (optional)

Enables debug mode in console

<div data-category-id="jeans-homme" data-reco-debug="true">

Event Actions available

Action ID
When it is triggered

show

When the banner appears in the DOM

go_to_page

When a product in the banner is clicked

add_to_cart_item

When a user adds one product to cart

add_to_cart_items

When the user adds all recommended products (e.g. bundles)

convert_xxx

When a conversion button is clicked

Important note

The tag automatically sends a show event as soon as an element with a data-category-id appears in the DOM. If you fill it asynchronously, make sure to add this attribute only after the items are rendered, otherwise the event will fire empty.

How to configure GTM / GA4 ?

The configuration is exactly the same as for Recommendations tracking. If you already have Recommendation analytics events in GA4 → nothing else to set up.

Otherwise, follow these steps:

1

Create a Trigger

  • Go to Triggers > New

  • Type: Custom Event

  • Event name: ab_recos.*

  • Check Use regex matching

  • Apply to All custom events

2

Create Data Layer Variables

Create these six variables:

Variable name
Data Layer variable name

reco_id

recos.reco_id

event_id

recos.event_id

item_ids

recos.item_ids

action_id

recos.action_id

category_id

recos.category_id

item_id

recos.item_id

You can access them in GTM via the data path recos.VARIABLE_NAME.

3

Create a GA4 Event Tag

  1. Go to Tags > New

  2. Tag type: Google Analytics: GA4 Event

  3. Event name: ab_recos

  4. Add your Measurement ID (from GA4 Admin > Data Stream)

  5. Add the six variables above as Event Parameters

  6. Trigger: the one created in step 1 (ab_recos.*)

Example event in the DataLayer

Show event

{
  "event": "ab_recos_12345",
  "recos": {
    "category_id": "jeans-homme",
    "action_id": "show",
    "item_ids": "[\"SKU123\",\"SKU456\"]",
    "debug_mode": false
  }
}

Click event

{
  "event": "ab_recos_67890",
  "recos": {
    "category_id": "jeans-homme",
    "action_id": "go_to_page",
    "item_id": "SKU123",
    "item_ids": "[\"SKU123\",\"SKU456\"]"
  }
}

How to test my reporting tracking ?

  1. Open your website

  2. Open the browser console

  3. Type:

    console.log(dataLayer)
  4. You should see events like ab_recos_xxxx containing category_id, action_id, and item_ids.

If these appear → the tracking setup is working. You can then see results in GA4 > DebugView, and later in AB Tasty Merch Reporting.

Notes & Limitations

  • Merch Analytics is currently available only for GA4.

  • Piano Analytics and Matomo are supported for Recommendations only.

  • Merch and Reco events share the same event name (ab_recos.*) and GTM configuration.

  • Activating this does not interfere with your existing analytics setup.

Last updated

Was this helpful?