Usecase & Goal
If you want to optimize and measure advanced events that are beyond standard analytics. With that, you can track any custom event client sided, e.g. "User dwells on pricing page for 15 seconds".
Later on you can make those custom events available in your dashboards - see this article: Create Custom Conversions
Note: This is an advanced setup. You can also integrate custom events with Google Tag Manager: Custom Event Tracking with Google Tag Manager
Code Integration
Integrate this script within your digital product:
<script>
window._adbq = window._adbq || [];
window._adbq.push([
'track',
'web_event_custom',
{
attributes: {
event: {
detail: 'Some Interaction', //Required
value: 10.00 //Optional
}
}
}
]);
</script>
To implement your custom event change the value of the event detail and event value variables. All other variables can not be changed.
Example for a Button Click Event:
<script>
window._adbq = window._adbq || [];
window._adbq.push([
'track',
'web_event_custom',
{
attributes: {
event: {
detail: 'Button Click XYZ',
value: 0
}
}
}
]);
</script>
Integrating this code varies for providers and depending on your setup - it's best to look up the providers documentation or ask the responsible technical person within your company.
If you need help with this integration, feel free to reach out to us!
If you want to see this event in your dashboard, you have to set it up as described in this article: Create Custom Conversions