LogoLogo
PlatformsPricingRessources
  • Home
  • Onboarding
  • User documentation
  • Release Notes
  • Help Center
  • User documentation
  • Dashboard
    • Global Experience Dashboard discovery
    • How to filter the Global Experience Dashboard
    • How to customize your Global Experience Dashboard
    • Uplift card
  • Web Experimentation and Personalization
    • Campaign creation and dashboard
      • Types of campaigns
        • Choosing the right type of campaign with Ally, our assistant
      • How to create a campaign
        • Experimentations
          • How to create an A/B Test
          • How to create a Multipage Test
          • How to create a Split Test/Test by Redirection
          • How to create an A/A Test
          • How to create a Patch / Multipage Patch
          • How to create a Multivariate Test
        • Personalizations
          • How to create a Multi-Experience Personalization
          • How to create a Multipage Personalization
          • How to create a Simple Personalization
      • Campaign duplication
        • How to duplicate a campaign
      • How to set-up Main Information step
      • Understanding campaign duration
      • Campaign loading (deferred/ instant)
      • The "Comment" section of the campaign creation flow
      • Campaign statuses
      • How to exclude IP addresses from your campaigns
      • How to use MDE Calculator
      • Campaigns Dashboard
      • Campaign Scheduler
      • Mutually Exclusive Experiments
      • How to use Campaign Prioritization
        • Prioritization of Personalizations
    • Editors and Widget
      • How to create and edit content in the visual editor
      • How to use our Visual Editor - Interactive demo
      • Discovering the Visual Editor
      • Visual editor - History and review of modifications
      • Code Editor
      • Using the Editor Copilot
      • Prompt Inspiration library for Visual Editor Copilot
      • How to create an Action Tracker in the editor
      • How to use redirection option
      • How to create trackers in the editor
      • Widgets
        • Widgets configuration in the visual editor
        • AB Tasty prebuilt Widgets
          • Action Button Widget
          • Banner Widget
          • Before-After Image Widget
          • CSAT Widget
          • Celebrate Widget
          • Countdown widget
          • Drawer Widget
          • Dwell Time Tracking Widget
          • Element Visible Tracking Widget
          • Iframe Click Tracking Widget
          • IFrame Widget
          • Image Pop-in Widget
          • NPS® (Net Promoter Score) Widget
          • Progress Bar Widget
          • Scratch card Widget
          • Scroll Rate Tracking Widget
          • Search & Replace Widget
          • Simple Popin Widget
          • Snowflake Animation Widget
          • Social proof Widget
          • Social Sharing Widget
          • Spotlight Widget
          • Sticky Element Widget
          • Tooltip Widget
          • Video Pop-in Widget
          • Virtual Click Widget
        • Custom widget
          • Custom Widgets: List of propname Fields and Their Specificities
          • Custom widgets: Global usage and information
        • Custom code widget
      • Chrome extension
      • Shadow DOMs & iFrames
        • Understanding Shadow DOM
        • How to edit Shadow DOM in the visual editor
        • Understanding iframes
        • How to edit Iframes in the visual editor
    • Goals step
    • Targeting step
      • How to set up a campaign Targeting
      • How to create a Segment (Who section)
        • Segments Recommendations
        • Inspiration with Engagement Level segmentation
      • How to define Targeted Pages (Where section)
      • How to create a Trigger (How section)
        • Geolocation criterion
        • Device criterion
        • Screen size criterion
        • IP address criterion
        • Weather criterion
        • Landing Page criterion
        • Source & source type criterion
        • Previous Page criterion
        • URL Parameter criterion
        • Minimum Pages viewed criterion
        • Visited Pages criterion
        • Same day visit criterion
        • Browser language criterion
        • Browser criterion
        • Adblocker criterion
        • JS Variable criterion
        • Code-based criterion
        • CSS Selector criterion
        • DataLayer criterion
        • Visitor attributes criterion
      • How to define a Targeting Frequency (When section)
      • How to set-up targeting verifications
      • How to use the replicate targeting option
      • How to use URL operators to build URL patterns
    • Traffic allocation step
      • Campaign flow: Traffic Allocation step
      • Dynamic allocation
      • Even allocation
    • Advanced Options step
      • Sequential Testing Alerts
    • QA step
      • QA Mode & QA Assistant
        • How to use the QA mode
        • How to use the QA Assistant on desktop
        • How to use the QA Assistant on mobile
      • How to use the browser console to QA a campaign
  • Feature Experimentation & Roll-Out
    • How to create server-side A/B tests
    • How to create feature toggles and manage rollouts
    • How to create server-side personalization
    • FE&R Glossary
    • Managing Flags
    • Managing Context Keys
  • Recommendations & Merchandising
    • Recommendations
      • Web recommendation
        • Most popular recommendation filters
        • Variables by placement
        • Placement
        • Products groups
        • Filters
        • Exceptions
        • Options
      • Recommendation Banner
        • Recommendation banner with tag and custom JS
          • Adding Recos Tag to a website
          • Enriching Recommendations Banner HTML to send events to DataLayer through Recos Tag
          • Setting up GTM to send Recos Datalayer Events
          • Connect Tag Assistant from GTM
          • Check that the events arrive correctly in GA
          • Check the display of recommendations
          • Retrieving recos products from a RECO_ID with Recos Tag
        • Deploying a Recommendations Banner Custom Widget
        • Retrieving a Recommendation RECO_ID
        • How to push recommendations with Adobe Campaign
        • How to build recommendations (recommendation builder variant)
      • Mail recommendations
        • How to push recommendations into your Brevo emails
        • Brevo Feed
        • Products groups
        • Filters
        • Products highlights
        • Exceptions
        • Options
        • Parameters
        • Preview
        • Most popular recommendation filters
    • Merchandising
      • Introduction
      • Category
      • Products groups
      • Filters
      • Products highlights
      • Exceptions
      • Result to refine
      • How to deploy a merchandised product list through Algolia
    • Recos & Merch analytics
      • How to track performances
      • Recos Analytics Event format
      • The impact of BigQuery exports in terms of cost
      • Setup analytics retrieve events with Recos Tag
      • Key indicators over the period & Segment
      • Overview data
      • Evolution metrics
    • Recos & Merch API
      • Getting a product list
      • Accessing Recos API (endpoint)
      • Accessing Recommendations API (only specific accounts)
    • Recos & Merch account management
      • How to manage users in Recommandation & Merchandising module
      • How to manage roles
      • How to manage synchronisations
      • How to manage invoices
    • Security and GDPR
      • Procedure for Reporting Personal Data Breaches
      • Backup Policy
      • Security Configuration of Our Servers
      • PSSI
    • Recos & Merch Algorythms
      • How to manage algorithms
      • How to create your algorithms
      • Better understanding
      • Default algorithms
      • Data used to train Algorithms
    • Recos & Merch integrations
      • Integrations with Recos & Merch
      • Brevo Integration
      • Analytic integrations
        • Google Analytics integration
        • Matomo integration
        • Random data integration
      • Recos & Merch CMS integration
        • PrestaShop integration
        • Shopify Integration
        • Custom integration
  • Emotions AI
    • Understand EmotionsAI
      • EmotionsAI in a nutshell
      • Leverage EmotionsAI to get more value from A/B tests
      • Leverage EmotionsAI to get high-potential A/B test ideas
    • First steps with EmotionsAI
      • Onboarding
      • EmotionsAI functioning
      • Navigating the interface
      • FAQ about EmotionsAI
    • Using EmotionsAI
      • How to activate EmotionsAI features
      • EmotionsAI Website Mapping configuration
      • EmotionsAI Journey Analysis
      • EmotionsAI Page Analysis
      • Target EmotionsAI segments
      • QA a campaign on Desktop with EmotionsAI Chrome Extension
      • Use EmotionsAI targeting on hard-coded personalizations
      • Usage of EmotionsAI in some Push integrations
    • Read EmotionsAI campaigns’ report
  • Library
    • How to set-up your libraries
    • Widget library
      • Creating and managing Widgets
      • How to create a preset Widget
      • How to create a Custom Widget
        • How to configure Custom Widgets Custom Forms
      • How to declare your Widget Theme
    • Assets Library
    • Trackers library
      • Action Trackers
        • How to create and manage Action Trackers
      • How to create a Custom Tracker with custom JavaScript code
      • How to create a Custom Tracker via the DataLayer
    • Creating and managing Segments
      • List of Segment criteria
        • CSAT criterion (Customer Satisfaction)
        • NPS® criterion (Customer Satisfaction)
        • Engagement Level criterion
        • EmotionsAI criterion
        • Content Interest criterion
        • Page interest criterion
        • Device criterion
        • Cookie criterion
        • New/Returning visitors criterion
        • Campaign Exposure criterion
        • Number of sessions criterion
        • Day(s) Since Last Session criterion
        • Day(s) Since First Session criterion
        • Action Tracker criterion
        • Cart Abandonment criterion
        • Last Purchase criterion
        • Purchase Frequency criterion
        • Geolocation criterion
        • DMP, CDP, rd party tool criterion
      • Segments Library - Metrics
    • Creating and managing Triggers
      • List of Trigger criteria
    • Creating and managing Saved Pages
  • Integrations
    • Integrations general information
    • Push integrations
      • Adobe Analytics
      • Air
      • Amplitude (analytics browser)
      • Amplitude
      • AT Internet Smart Tag
      • Contentsquare
      • Google Analytics (Audience creation)
      • Google Analytics (UA)
      • Google Analytics (event only)
      • FullStory
      • Heap Analytics
      • Hubspot
      • Matomo
      • Mixpanel
      • Piano Analytics
      • SalesForce Marketing Cloud (Push)
      • Segment
      • Tealium
    • Pull integrations
      • Air
      • Commander Act
      • EmotionsAI
      • Fullstory
      • Google Analytics
      • Heap Analytics
      • Mixpanel
      • mParticle
      • Piano Analytics (Pull)
      • SalesForce Marketing Cloud (Pull)
      • Segment
      • Tealium : Import Audiences
      • Weborama
    • Other integrations
      • Productivity
        • Microsoft Dynamics Commerce
        • Setting up Microsoft Clarity Integration with AB Tasty
        • Didomi
        • How to Set Up the AB Tasty Connector with Notion
        • How to connect AB Tasty to Google Sheets
        • Connect your Slack Workspace to AB Tasty
      • Data Warehouse
        • Data Warehouse integrations: General information
        • Big Query - Daily exports from AB Tasty to Big Query
        • Snowflake - Daily exports from AB Tasty to Snowflake
        • Redshift - Daily exports from AB Tasty to Redshift
    • Custom integrations
      • Universal Data Connector
      • Custom Integration Connector with a rd party tool (Push data)
      • AB Tasty public API
  • Reporting & Performances
    • Data Explorer
      • How to analyze page traffic via Data Explorer
      • How to get metrics breakdown by multiple dimensions via Data Explorer
      • How to get a list of recent hits via Data Explorer
      • Data Explorer - List of Metrics and Dimensions
    • ROI dashboard
    • Performance Center
      • List of Performance Guidelines
    • Reporting
      • Campaign reporting
        • Reporting Copilot
        • Analysis Copilot
      • Data & reports: generalities and definitions
      • AB Tasty reports Metrics
        • Live hits of the reporting
        • Metrics based on tracking widgets
        • Navigation metrics
        • Metrics based on pageviews
        • Metrics based on clicks
        • Metrics based on transactions
      • Reporting Filters
        • General Reporting filters
        • EmotionsAI Reporting filter templates
      • Using the NPS®️ report
        • How does Feedback Analysis Copilot work
      • Sample ratio mismatch
      • Refresh reporting data using Refresh On Demand
      • Data export from the reporting
      • Frequentist Analysis mode
      • Understand the statistics behind your Reports
        • Statistics for the reporting
        • Statistical metrics
        • Avoiding Pitfalls in AOV Analysis for Conversion Rate optimization
        • Conversion mechanisms & concepts
        • Reporting Readiness
  • Account
    • Tag integration
      • All About Tags
      • How to implement the Generic Tag
        • AB Tasty hosted tag implementation
        • Tag Domain Delegation
          • Tag domain delegation implementation
      • How-to QA the Generic Tag
      • How to implement the Generic Tag via Google Tag Manager
      • How-to join the Next tag program
      • AB Tasty integration with Shopify
        • Understanding Shopify App features
        • How to implement the AB Tasty tag via Shopify
        • How to set-up Shopify Custom Pixel App
      • AB Tasty tag compilation
      • How the AB Tasty tag is designed to handle Single Page Apps (SPA)
    • Technical implementation
      • How to choose your cookies deposit method
      • How to declare my Account Domain?
      • JavaScript in AB Tasty
        • How to configure JavaScript
        • Javascript files execution
        • Campaign JavaScript Execution
      • How to configure jQuery loading
      • How to integrate Product hits
      • Product Hits integration principles
        • How to set-up segment criteria "Content Interest" and "Cart Abandonment"
    • Transaction Tag integration
      • How to implement the Transaction tag
      • How to create a Transaction Tracker via DataLayer
      • How to use the Transaction Tag Generator
      • How to QA the Transaction tag
    • Performance and security
      • How to manage visitor identity
      • How to deactivate AB Tasty
      • Consent policy - cookies, storage and privacy
    • Account management
      • The organization page
      • Subscription page
      • How to manage users?
Powered by GitBook
On this page
  • Requirements
  • Tracking the value of a key in your DataLayer
  • Structure of the DalaLayer items
  • Managing the dot (“.) inside a key
  • Tracking the value of nested keys in your DataLayer
  • Tracking a key with a dot inside
  • Tracking a combination of key:value pairs
  • Option Some
  • Option All
  • Using the custom tracker

Was this helpful?

Edit on GitLab
Export as PDF
  1. Library
  2. Trackers library

How to create a Custom Tracker via the DataLayer

PreviousHow to create a Custom Tracker with custom JavaScript codeNextCreating and managing Segments

Last updated 9 days ago

Was this helpful?

LogoLogo

AB Tasty Website

  • Home page AB Tasty
  • Blog
  • Sample size calculator
  • Release note

AB Tasty Plateform

  • Login

© Copyright 2025 AB Tasty, Inc, All rights reserved

You can create Custom Trackers directly linked to the DataLayer you have implemented in AB Tasty. These Custom Trackers can then be used to create metrics based on your DataLayer data.

Custom tracker can also be created JavaScript code, for more information, refer to .

Requirements

To create a Custom Tracker via DataLayer you must:

  • Declare a DataLayer on this

The available DataLayer are the following:

  • Google Tag Manager

  • Tealium

  • Commander Act

We don’t manage the custom dataLayer as we can’t predict its structure.

To create a custom tracker for your DataLayer:

  1. Click Create Custom Tracker on the top right of the table.

  2. Select From a DataLayer.

Tracking the value of a key in your DataLayer

Structure of the DalaLayer items

Each dataLayer has their own structure. Let’s focus on Google Tag Manager. Inside GTM, the items belonging to the DataLayer have 2 different structures:

Objects

It can be an item that looks like a JS object with an association of key / value.

{
    "event": "nameEvent",
    "eventCategory": "nameCategory",
    "eventAction": "nameAction",
     "gtm.uniqueEventId": 332
}

To retrieve one key / value association inside this payload, you have to select the object option. (for example, to search the eventCategory)

“Arrays” (specific to GTM)

Or, we could have other items with a different structure. We call them array items (FYI, it’s not a real JS array). But, we have some items with this structure:

[
.....
13: Arguments(3) : ['event', 'nameEvent', { payload here}], 
....
]

Deeper with details

{
    "0": "event",
    "1": "abtasty",
    "2": {
        "abtasty_campaign": "[campaignId] campagnName",
        "abtasty_variation": "[variationId] variationName",
        "send_to": "XXX",
        "exp_variant_string": "value variant string"
    }
}

Here, we have different indexes. The index 0 is relative to one event (string), the second one to another string (name of the event) and the third (last) one to a payload. This structure is not a structure by default. You can have another structure (payload inside item 1 for example). To look for the abtasty_campaign for example, you have to choose the array option and provide on which index we have to research.

We are not able to research a string inside an array (as a value). For example, searching for the index 1 with the value abtasty is not possible. The payload linked to the dedicated index has to be a JS object.

The custom tracker will be fired when a field, specified by you, matches a certain condition. These are the steps:

  1. Giving the custom tracker variable a name. This name can be anything you choose and only aims at helping you recognize what you create.

  2. The “key” is the name of the field you want to track in your DataLayer

  3. The dropdown menu contains a list of operators that allows you to check for the state or value of the field in the DataLayer. The list of operators:

Operator

Description

Equals

Real key value = Target value

Does not equal

Real key value ≠ Target value

Is lower than

Real key value < Target value. This has to be a numerical value.

Is higher than

Real key value > Target value. This has to be a numerical value.

Is included between

Upper Target value > Real key value > Lower Target value. These have to be numerical values.

Contains

Example: the value “homeowner” contains “meow”. That will trigger the tracker. This is mainly for string data types.

Is true

for a boolean value. value is true

Is false

for a boolean value. value is false

Is declared

The key exists in the DataLayer. This does not need a value.

Is not declared

The key does not exist in the DataLayer. This does not need a value

  1. Select the value of the key that would trigger the Custom Tracker: Each time the value will match your rule, an event will be fired via our tag Datacollect.

An example is given in the image below:

It means that, once saved, the custom tracker will be triggered when the DataLayer has a field “event” having a value of exactly “gtm.load”. The final steps are to Save the custom tracker, and reload your tag.

Managing the dot (“.) inside a key

Tracking the value of nested keys in your DataLayer

The DataLayer typically will not have a single level of key:value pairs. It may have nested keys, like in a typical object. In the previous section, the key:value pair was a first level pair.

You may want to track a 2nd level or even 3rd level key:value pair, like in the image below:

To track nested keys like “pagetype” or “type”, the key field in the custom tracker creation modal can be input with dots (.) as shown:

  • page.pageType - this will have a value of “HOME”

  • page.device.type - this will have a value of “mobile”

Arrays are not handled in the DataLayer for the moment, but only objects and subobjects.

Tracking a key with a dot inside

Instead of looking for the value of nested keys, we can have keys using dots (“.”).

For example:

{
    "gtm.start": 1714033074154,
    "event": "gtm.js",
    "gtm.uniqueEventId": 1
}

To search the gtm.uniqueEventId, you must use double quotes in order to specify that the key has a dot (“.”) and that you don’t want to track a value of a nested key.

Tracking a combination of key:value pairs

It is possible to have a custom tracker triggered by several conditions being true. Taking the last examples in the previous section, the custom tracker will be triggered if “page.pageType” is equal to “HOME” only. The Custom tracker can also be triggered by BOTH “page.pageType” = “Home” AND “page.device.type” = “mobile”. To do this, create a custom tracker and click on “Add condition”. This will show a second row of inputs to specify another condition.

Option Some

As soon as you have at least 2 conditions, a new dropdown appears. The first option is “some”. It means that at least 1 condition needs to be true for the tracker to be triggered. If both are true, it will also be triggered. If none are true, it will not be triggered.

Option All

If you select “all”, it means that both (or all, in case there are more than 2) conditions need to be true for the tracker to be triggered. If only 1 is true, the tracker will not be triggered. If none are true, it will also not be triggered.

When selecting the “all” option, you can choose between two other options:

In any Event of the Datalayer : (Only for GTM)

It means that you can check if there’s a matching of all the conditions in all the items of the DataLayer. For example, a DataLayer with this structure:

[
......
{
 event: "page_view"
 page: {
  pageType: "HOME"
}
},
..., 
{
event: "device"
page: {
 device: {
  type: "mobile"
}
}
}
]

In this example of a GTM DataLayer, we search these two conditions in all the DL. In this case, the matching is a success.

In the same event : (Only for GTM)

If you select this option (for the “all” option), all the conditions must be in the same event. If it’s not the case, we don’t parse the other items belonging to the DL (instead of the other option). That’s why in the previous example, the dataLayer must be like this:

[
....
{
page: 
{
 pageType: 'HOME'
device: 
{
type: "mobile"
  }
}
}
....
]

Once again, once the custom tracker is created and saved, do not forget to refresh your tag.

Using the custom tracker

Once custom trackers are created, they can be used as goals for your reporting. To include them in your Reportings:

  1. Go to the goal step of your campaign

  2. Choose “Custom Trackers”

  3. In the middle pane, you should see the custom tracker you created with the name you gave them (see first section)

  4. You can then drag and drop them as primary or secondary goals from here.

  5. Save.

The DataLayer is a global array which is displayed when one website is also loaded. When a user makes any action on the website, some new items could be pushed inside this array. That’s why the DataLayer could grow up. Once you’ve finished setting up one or several custom trackers on app2, we are able to detect if the association key:value is already inside the DataLayer or if it is inside a new pushed item.

From the (Library > Tracking > Trackers), go to the Custom Trackers tab.

Trackers page
How to create a Custom Tracker with custom JavaScript code
page