Introduction¶
Harvest Collect has several important functions and one of it is to let you use tools like the Harvest Store, Google Analytics or Facebook.
What is a tool?¶
A tool is an application you want to send data to or want to use on your website. Examples are:
Tools that require data
- Google Analytics
- Google Ads
Tools that you want to use on your website
- AB-testing and personalization (Optimizely, Visual Website Optimizer, etc.)
- Live chat
- Chatbots
- Pop-ups
To make use of these tools, you will need a tool configuration. A tool configuration is basically all required information to be able to send data to or make use of a tool.
If you want to send data to Google Analytics, you will need a UA-code, if you want to send data to Facebook, you will need a pixel ID.
In Harvest we have a selection of tool templates which you can use to create your tools. It is also possible to use the same tool multiple times as can be seen in the examples below.
For more information about tool templates, read the tool templates documentation.
Each event that is processed, will look at the configured tools. In each tool you can (conditionally) tell Harvest what the tool configuration should be for the event.
You can configure the following for a tool:
- Default tool configuration
- Tool configuration
- Targeting
- Blocking
- Required consent
- Variable mapping
- Global settings
- Tool functions
Let’s start with an example.
Let’s say you have two domains: www.exampleA.com and www.exampleB.com. You want to use the following tools:
- Google Analytics
- Google Ads Remarketing
- Google Ads Conversion
Each domain has a checkout process. You have configured the following funnelsteps:
- Checkout - Cart
- Checkout - Shipping information
- Checkout - Payment information
- Checkout - Success
We have also configured the following domains:
You want to track user interactions on both websites. To track user interaction in Google Analytics, you will need 2 things:
- A datalayer*
- A tool configuration for each tool
*To implement the datalayer, you will use our tracking code. For more information, read our tracking code documentation.
What is a tool configuration?¶
Any tool requires a form of configuration. If you want to use Facebook, you will have to set the ID of the pixel. If you want to use Google Analytics, you will need a UA-code.
These configuration are usually dependent on the type of interaction or the place where the interaction occurs. An example is that you will use a different UA-code for Google Analytics for each domain you have.
What is the difference between a tool configuration and global settings?¶
Besides tool configuration, which can be dependent on something, we also have global settings. These settings are always the same for the tool, regardless the interaction or the place where the interaction occured.
You could argue that sometimes the pixel ID of Facebook will also always be the same. That is true, but it can be dependent. This is different from global settings, because they always are the same.
An example could be that you turn on Enhanced Ecommerce functionality for Google Analytics.
Default tool configuration¶
In the scenarios mentioned earlier, we did not have very complex and long conditional tool configurations. It is however possible that you will have more than 100 domains. You could use the Harvest Store, which requires two variables:
- Host (the host of your Harvest store)
- Index (the index to which the data should be sent)
Usually for all domains the Host will be the same, but the index will change per domain or group of domains. We could then use the following configuration:
Name: Harvest Store
Default configuration:
Data - {
"host": "https://store.harvest.graindata.com"
}
Configuration:
Domain
If domain https://wwww.exampleA.com
Data - {
"index": "website-a"
}
If domain https://wwww.exampleB.com
Data - {
"index": "website-b"
}
As you can see, we only set the index in the conditional configuration and set the host in the default configuration. This saves you a lot of configuration.
Tool configuration mapping¶
Google Analytics¶
Google Analytics per domain
For Google Analytics, the basic tool configuration contains the UA-code. Since we have 2 domains with each a different UA-code, we could implement this as follows.
Name: Google Analytics Per Domain
Configuration:
Domain
If domain https://wwww.exampleA.com
Data - {
"uaCode": "UA-12345-6"
}
If domain https://wwww.exampleB.com
Data - {
"uaCode": "UA-65432-1"
}
Whenever we process an event on exampleA.com, Harvest will check the tool configurations. It will find 1 tool configuration named Google Analytics Per Domain. It will check whether there is a conditional configuration. It sees we have defined a conditional configuration based on Domain. We have triggered the event on exampleA.com, this means that Harvest will choose the configuration UA-12345-6 for this event. This means the data will be sent to Google Analytics to property UA-12345-6.
For exampleA.com the toolData will look like this:
{
"Google Analytics Per Domain": {
"uaCode": "UA-12345-6"
}
}
Google Analytics Roll-up
Besides tracking seperately for each domain, it might also be really handy to have 1 so called roll-up account for Google Analytics. If we add this to our tool configurations, we will have the following:
Name: Google Analytics Per Domain
Configuration:
Domain
If domain https://wwww.exampleA.com
Data - {
"uaCode": "UA-12345-6"
}
If domain https://wwww.exampleB.com
Data - {
"uaCode": "UA-65432-1"
}
Name: Google Analytics Roll-up
Configuration:
Data - {
"uaCode": "UA-941230-5"
}
Now there are 2 configurations defined. If we track an event on exampleB.com, we have to configure 2 configurations. In this case, we will also take a look at the tool configuration named Google Analytics Roll-up, since this configuration has no condition, the configuration will always have the value UA-941230-5.
For exampleB.com the toolData will look like this:
{
"Google Analytics Per Domain": {
"uaCode": "UA-65432-1"
},
"Google Analytics Roll-up": {
"uaCode": "UA-941230-5"
}
}
Unmatched domain
Let’s say we have an event from exampleC.com. This domain would not match with any domain in Google Analytics Per Domain. If this happens, the tool configuration will return “Could not find a configuration match.” This means that the toolData will look like this:
{
"Google Analytics Per Domain": {
"notLoadedReason": "Could not find a configuration match."
},
"Google Analytics Roll-up": {
"uaCode": "UA-941230-5"
}
}
Google Ads Remarketing¶
Similar to how we just configured Google Analytics, we can also a conditional configuration based on Domain for Google Ads Remarketing.
Name: Google Ads Remarketing
Configuration:
Domain
If domain https://wwww.exampleA.com
Data - {
"id": "123123sdfsfd123123123"
}
If domain https://wwww.exampleB.com
Data - {
"id": "91231239123sdfsdfsd91231"
}
An event on exampleB.com will result in:
{
"Google Analytics Per Domain": {
"uaCode": "UA-65432-1"
},
"Google Analytics Roll-up": {
"uaCode": "UA-941230-5"
},
"Google Ads Remarketing": {
"id": "91231239123sdfsdfsd91231"
}
}
Google Ads Conversion¶
For the Google Ads Conversion tool configuration, we will have the create a more complex tool configuration. This is because we have a different conversion label for a conversion on exampleA.com and exampleB.com. The tool configuration will look as follows:
Name: Google Ads Conversion
Configuration:
Domain
If domain https://wwww.exampleA.com
FunnelStep
If FunnelStep Checkout - Success
Data - {
"id": "123123sdfsfd123123123",
"label": "jsdlfjlsdkgjljsdf"
}
If domain https://wwww.exampleB.com
FunnelStep
If FunnelStep Checkout - Success
Data - {
"id": "91231239123sdfsdfsd91231",
"label": "asasdfsabasfaersdf"
}
The first level is similar to that of the Google Ads Remarketing tool configuration. We will check for a domain. However, this time, we will not find “Data” after matching a domain, but we see that we will need to match a FunnelStep. Then, we see that there is only one funnelstep defined: Checkout - Success. This makes sense, because we currently only have 1 conversion, which is a successfull checkout.
The above diagram shows you quite clear what conversion pixels we have defined. The moment we have a Checkout - Success funnelstepview on exampleB.com, we will have the following toolData:
{
"Google Analytics Per Domain": {
"uaCode": "UA-65432-1"
},
"Google Analytics Roll-up": {
"uaCode": "UA-941230-5"
},
"Google Ads Remarketing": {
"id": "91231239123sdfsdfsd91231"
},
"Google Ads Conversion": {
"id": "91231239123sdfsdfsd91231",
"label": "asasdfsabasfaersdf"
}
}
Any other event, like a pageview, will result in:
{
"Google Analytics Per Domain": {
"uaCode": "UA-65432-1"
},
"Google Analytics Roll-up": {
"uaCode": "UA-941230-5"
},
"Google Ads Remarketing": {
"id": "91231239123sdfsdfsd91231"
},
"Google Ads Conversion": {
"notLoadedReason": "Could not find a configuration match."
}
}
Targeting¶
You have already seen that when there is no match in the conditional tool configuration, Harvest returns “Could not find a configuration match.”. This is already a way to target on specific domains and block domains which you have not configured.
This can however not be satisfying. That is why it is also possible to set specific targeting options. You can set targeting options for the following entities:
- Event type
- Pagemarkers
- Content interactions
- Funnelsteps
- Domains
We could rewrite our Google Analytics Per Domain tool as follows:
Name: Google Analytics - exampleA.com
Configuration:
Data - {
"uaCode": "UA-12345-6"
}
Targeting
Domain
- https://wwww.exampleA.com
Name: Google Analytics - exampleB.com
Configuration:
Data - {
"uaCode": "UA-65432-1"
}
Targeting
Domain
- https://wwww.exampleB.com
As you can see, we now have created 2 tools. For each domain one. We have set the configuration unconditional. This means that for any event the tool configuration will be set.
However, we now have set targeting with a specific domain. This means that even though we have a tool configuration match, the tool configuration match will only be set if we match with all targeting options. This means that for each type of targeting at least 1 match will be made. You can for example add multiple domains for targeting, you do need to match all domains (which is not possible).
The above example is not something you will want to use. We could however say that we want to use the Google Ads Remarketing tool, but only when the event type is a pageview.
Name: Google Ads Remarketing
Configuration:
Domain
If domain https://wwww.exampleA.com
Data - {
"id": "123123sdfsfd123123123"
}
If domain https://wwww.exampleB.com
Data - {
"id": "91231239123sdfsdfsd91231"
}
Targeting
Event type
- pageview
This way, the tool configuration will only be set on either exampleA.com or exampleB.com when the event type is a pageview.
Blocking¶
Sometimes it is easier to say when a tool should not be used instead of saying when it should be used. Just as with targeting, you can block on the following entities:
- Event type
- Pagemarkers
- Content interactions
- Funnelsteps
- Domains
As an example, we could change the example of targeting on a pageview to blocking.
Name: Google Ads Remarketing
Configuration:
Domain
If domain https://wwww.exampleA.com
Data - {
"id": "123123sdfsfd123123123"
}
If domain https://wwww.exampleB.com
Data - {
"id": "91231239123sdfsdfsd91231"
}
Blocking
Event type
- contentview
- click
- funnelstepview
- change
- dataview
The above example has the same effect as the example for targeting. Whenever any entity is matched for any blocking option, the tool configuration will not be set.
Required consent¶
This configuration is closely related to cookie consent. For more information, read our cookie consent documentation.
In our consent module, you can define which permissions a user can give. In the required consent option for tools it is possible to say which consent is required before we can sent the tool.
Let’s say we only want to use Google Ads Remarketing when the “advertising” permission is given.
Name: Google Ads Remarketing
Configuration:
Domain
If domain https://wwww.exampleA.com
Data - {
"id": "123123sdfsfd123123123"
}
If domain https://wwww.exampleB.com
Data - {
"id": "91231239123sdfsdfsd91231"
}
Required consent
- advertising
This way, even though there is a tool configuration match, when a user did not give the advertising permission, the tool configuration will not be set.
Variable mapping¶
Often it is possible to send extra information to tools. If we look at Google Analytics, it is possible to send custom metrics and custom dimensions. If we take a look at Google Campaign Manager, it is possible to send u-values.
You can use variable mapping to map variables in Harvest or fixed values to these tool specific variables.
Global settings¶
Each tool needs a configuration before it works. Usually the configuration can be dependent on the domain you are on or for example is based on the funnelstep a user has triggered.
However, some variables can not be dependent on a domain. These configuration are “globally” and static. An example is whether you want to use cross domain tracking in Google Analytics or not.
Note that not all tools have global settings.
Tool functions¶
There are several functions a tool can perform. Not every tool can perform every action. You can find more information about the meaning of each function in the tool templates documentation.
We have the following functions:
Initialize
This means that Harvest will initialize the tool. Let’s say you want to use Optimizely and choose the function “Initialize”. This means that Harvest will load the Optimizely script.
Post processing
This means that the tool will perform an enrichment on the event that is being processed. An example is that when choosing this function with Google Analytics, it means Enhanced Ecommerce data will be enriched.
Distribution
This means that we will distribute the data to the specified tool. Let’s say you have chosen this function for Facebook, then it means we will send the events to Facebook. Note that it might be required to have the tool initialized. This initialization can then be done by Harvest (by using the Initialization function) or you can load the library yourself.