Integrating third-party analytics
While Customizer primarily saves data to its own analytics storage, it also supports integration with third-party packages. Whenever an action is tracked using the trackAction method or generated automatically, an integration event is triggered for the respective Controller class instance, allowing seamless integration with external systems.
Analytics event
The trackAction event allows customers to capture event parameters and forward them to their analytics system of their choosing.
Event parameters: trackAction(map), where map is a name/value pairs list of event variables.
For example:
controllerInstance.on('trackAction', (toTrack) => {
if (toTrack.event) {
dataLayer({
event: toTrack.event,
category: toTrack.category,
label: toTrack.label,
});
}
});