Tracking events
To meet demands of using different third party solutions to track engagement, the Green Housing widget offers a callback function that pass information about any occuring events.
You can provide a custom function that you would like to trigger via configuration.onEvent at mount.
const configurationOverrides = {
...
onEvent(event) {
ga('send', 'event', event.category, event.action, event.label, event.data);
},
...
};
EconansGreenHousing.mount("#widget", configurationOverrides);
Example configuration of onEvent
Events
Any user interaction with input fields, buttons etc will trigger an event. We also trigger events containing some information about the calculated result.
Things that are tracked:
- Changes in input fields
- Clicks on buttons, links and other UI elements
- When the widget is loaded
- Data about the calculated result
- Navigation in the widget
Data about the event is provided as an object with the following properties:
{
source: 'widget' | 'user', // Events are categorized based on what/who that trigger the event
action: 'loaded' | 'input' | 'click' | 'result' | 'navigate', // The type of event
label: string, // A description of the event
data: {...}, // Optional property that provides any detailed data to complement the label
isUserInteraction: boolean, // Flag that describes if the event is triggered by a user interaction
}
If you need more detailed information about tracking and events, contact Econans at hello@econans.com