Verifying the DataLayer Tagging Plan
The objective here is to ensure that your DataLayer is not only present, but that it contains the right information, in the right format, on the right pages.
Prerequisites: You must have created at least one DataLayer type collector (e.g. dataLayer GTM).
Go to DataLayer > Tagging Plan. You will see a table with your contexts in columns and the parameters of your DataLayer in rows.
There are two methods to populate this table:
1. Automatic configuration (recommended to start)
Netvigie Tracking can help you by inspecting your pages to discover the parameters already present.
- Click on the name of a context in the table header (e.g. "Product Page"). A configuration window opens.
- Click on the Verify button. Netvigie Tracking will analyze the example URL of your context.
- After a few moments, an "Infos" button or a message indicating the found parameters will appear.
- By clicking on it, you will see the list of parameters detected in the DataLayer and their current value.
- Next to each parameter, a
+button allows you to add it directly to your tagging plan configuration.- Collector magic: If the detected value (e.g. "Cool T-shirt") corresponds to the value returned by one of your collectors (e.g. the
{{Product Name}}collector), Netvigie Tracking will automatically propose using this collector in the rule. It is a huge time saver.
- Collector magic: If the detected value (e.g. "Cool T-shirt") corresponds to the value returned by one of your collectors (e.g. the
- Repeat the operation for all the parameters you wish to verify.
- Save.
2. Manual configuration
If you know your tagging plan precisely, you can create the rules manually.
- In the table, click on the
+at the intersection of the desired context column (or "All contexts") and the "Add a parameter" row. - Configure the rule:
- Parameter: The name of the variable in the DataLayer (e.g.
product.id). - Rule type: The verification condition (see below).
- Value: The expected value. It can be:
- A fixed value:
production. - A collector:
{{Product Reference}}. - A regular expression (REGEX):
[0-9]+.
- A fixed value:
- Parameter: The name of the variable in the DataLayer (e.g.
The most common rule types:
must be exactly: The value must match perfectly.must contain: The value must include the specified string.must match regex: The value must validate the regular expression.must be greater/lower than: For numeric comparisons.must be defined: The parameter must exist, even if its value is empty.must not be defined: The parameter must not exist.must be in: The value must be part of a list of possible values.