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.
You may be interested in our article explaining how to create and validate a custom field.
What is a Data Layer?
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:
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.
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 first crawl with your custom fields is finished, click the "Configure Segmentation" on the project homepage or from any analysis page.
Create a new segmentation and select start from scratch.
Give it a name; we suggest naming it something similar to your custom field name.
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.