-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hi!
I configured the plugin as on documentation, but I am not able to get the sa_event from the window, the auto events works fine.
In gatsby-config.js:
{
resolve: "gatsby-plugin-simple-analytics",
options: {
trackPageViews: true,
events: true,
eventsGlobal: 'sa_event',
},
},
I am using "gatsby": "4.15.2".
Tracking event function implementation:
export const trackEvent = (type: EventType, metadata?: Object) => {
if (window && window.sa_event && metadata != null) {
return window.sa_event(type, metadata);
} else if (window && window.sa_event) {
return window.sa_event(type);
}
return null;
};
What am I doing wrong?
JackLot
Metadata
Metadata
Assignees
Labels
No labels