What is an OnCrawl Custom Field?

Custom Fields are extractor code that you setup before a crawl. They allow to extract data from each page thanks to two types of rules: XPATH and REGEX.

An article dedicated to their creation is available here : How to create and validate a Custom Field ?

What is a Data Layer?

A Data Layer is a JavaScript object, which contains a large amount of information, which you can then forward to a data manager (such as Google Tag Manager). The information contained in a Data Layer is highly variable: data related to mobility, personal information, e-commerce transactions. They are very different, but their presentation follows a clear rule.

The information contained in the Data Layer, i. e. the "data layer", is formed by a pair: each time you find a name, and its variable.

The Data Layer is implemented in the html code. Just like other scripts, such as Google Analytics, a Data Layer will collect interaction information, allowing you to track useful data to improve the user experience.

What is particular on GTM (Google Tag Manager)?

As it says in the Google Tag Manager documentation, here:
The Google Tag Manager container snippet is a small piece of JavaScript and non-JavaScript code that you paste into your pages. It enables Tag Manager to fire tags by inserting
gtm.js into the page (or through the use of an iframe when JavaScript isn't available).

Here we are, there are variables in the pages that must be filled in to define the Data Layer (this is the case with all Data Layers based source codes).

OnCrawl allows you to extract this code during the Crawl. These Custom Fields will therefore be present in the Crawl report's data and can be used as categorization elements.

GTM example 

This example is from the Google developer help page, here.

Custom Field to extract the PageCategory value:

Custom field name: pageCategory
Rules kind:                REGEX
Extract type:             Value
Rules:                         'pageCategory' : '([^']+)'

Once you have defined your Custom Fields - as a reminder here's how to do it - and your crawl is finished, go to the Categorization screen by clicking on the Setting/Configure page groups menu on the project homepage.

  • Create a new Page Group Set, named as you like.

Important: you do not have to check the "I want to use set on logs...." box, but it reassures you that the set will be usable in the combined Log/Crawl analysis.

  • Create a new Group, named it with the one of your Data Layer extracted text
  • Chose to filter pages with "Custom Field: [name]" "is" "[extracted text]"
  • Do this for all your groups

Tip: start typing "Custom" in the box to quickly get access to your Custom Fields


You now have with a dynamic categorization (it will be automatically enriched after each crawl) that exactly corresponds to your Data Layer categories.

To use these new segmentations, simply choose the one that interests you thanks to the filters at the top of each OnCrawl screen.

Did this answer your question?