Variables¶
Variables are used to provide meta data.
More information about variables can be found in the variables documentation in the data model section.
Variable groups¶
All variables are categorized in a variable group. This makes it much easier to debug and use the variables. More information about each variable group and what default variables are in them, can be found in the variables documentation.
Variable types¶
There are two types of variables:
Dimensions
These variables are also called labels. They allow you to categorize your metrics (statistics). Think about the fact that you want to track pageviews (a metric) and want to know how the total pageviews are divided over the pages you have. In this case, the variable “page” is a dimension.
Another example can be given by the amount of purchases (metric) and the value of these purchases (metric) and how they are divided over the webshops you have. In this case, the url or name of the webshop is a dimension.
Some other examples are:
- Shoe size
- Gender
- Language
- Product name
Metrics
Metrics are the actual numbers. Example of metrics are:
- Count of pageviews
- Count of purchases
- Count of newsletter subscriptions
- Count of user registrations
List variables¶
If you want to track a dimension, you can choose whether you want to track single values or multiple values.
Single value
A single value is what you will use most likely. Think about a user name, product name, shoe size, or any other variable where you track one value at the time.
Multiple values
Examples of variables that will hold multiple values at once are:
- A list of interests the user has
- A list of categories a product belongs to
- A list of tags a certain page has
Query string parameters¶
By default, Harvest will work based on the information provided in the datalayer. It is however also possible that information is provided in the url by query string parameters. It is possible to let Harvest obtain values from the url by linking a query string parameter to your variable.
Valid values¶
We use meta data extensively in Harvest Collect, because meta data makes the tracking of user interactions valuable.
Most variables can have any value, because they are free form or can have too many values to list.
For some variables, however, it is possible to list a whitelist of valid values. This ensures data quality.
In Harvest Collect it is possible to create a list of valid values. If a invalid value is sent to Harvest Collect, the event that is triggered will error. This way, the developer gets feedback of the invalid value and our data will not be contaminated.