Final eventΒΆ
An important aspect of the data model is the fact that with little information from the developer in the datalayer, we can create a rich and extensive data object.
Before you read further, it is recommended to read the tracking code documentation, so you know more about how the tracking of Harvest Collect works.
It is also recommended to read our console debugging documentation to understand how you can see yourself how the data object is generated.
As an example, we demonstrate tracking of pageview. Before you trigger the pageview, set debugging on in the console.
harvest.trackEvent({
"event":"pageview",
"data": {}
});
After you executed the code above in the console, you will notice that the function returned an array of objects. In this case with 1 object, because we only triggered one event.
As you can see, we sent only little information to harvest.trackEvent, but we got a complext data object back. You can zoom in on each data object for now, and will notice many default variables, as mentioned in our meta data documentation.
You will notice the following properties:
- event - This tells us what event type generated the event.
- consentData - This contains all information about consent.
- debugData - This contains all information about the user agent and screen. Relevant information for debugging.
- eventData - This contains all information relevant for this specific event. All uncategorized variables will stay in eventData.
- pageData - This contains all information relevant to the current page.
- userData - This contains all information relevant to the current user.
- sesionData - This contains all information relevant to the current session.
- funnelData- This contains all information relevant to the curent funnelstep.
- promotionData - This contains an array of promotions that were viewed or clicked on. Only available when promotions are tracked.
- productData - This contains an array of products that were viewed or clicked on. Only available when products are tracked.
- contentData - This contains an array of contents that were viewed or clicked on. Only available when contents are tracked.
- toolData - This is a special object, it contains all tool configurations.
Especially toolData can be handy to see what decisions Harvest Collect made for your tools. For more information read our tool configurations documentation.