I have my site sending GA events fine such as page views and search events etc, but I have tried implement some code to create a custom event when zero results are displayed from a search, and this doesn’t seem to be working. The function is being called, but the trackEvent call doesn’t seem to be raising anything in Google Analytics. Hopefully someone can explain what I’m doing wrong here - thanks in advance!
My code;
export function sendEvent () {
console . log ( ‘Entering sendEvent function’ );
wixWindow . trackEvent ( “CustomEvent” , {
“event” : “NoResultsFound” ,
“eventCategory” : “Search” ,
“eventAction” : “Search” ,
“eventLabel” : “No results from search!”
} );
console . log ( ‘sent trackEvent’ );
console . log ( ‘Leaving sendEvent function’ );
}
This function is definitely being called, as I see the console log msgs, and I’ve published this code and have tried this on the live site, but nothing is being seen in the GA console.
PLEASE HELP!
Thanks.