-
Troubleshooting: Custom Events not appearing in Google Analytics 4 reports or realtime view except in debug mode
So, I’ve got Vue 3 + Nuxt running alongside Google Analytics 4 (GA4) using this nifty little tool I found, the Nuxt gtag.js module. All’s well; GA4 is doing its thing, reporting all the basic events like page_view, scroll, and click. But then, I try to chuck in a recommended event, the ‘search’ one, and boom – we’ve got problems.
To start with, it’s nowhere on the reports. I know, I know, I’ve heard it takes 12 – 24 hours for it to show. But it’s also a no show in the real-time reports. Weird right?
Now for the kicker – if I turn debug_mode on, the elusive ‘search’ event appears. It’s there on the debug view (Admin) and in the realtime view. It’s coded like this:
`javascript
gtag(“event”, “search”, {
search_term: mySearchTerm,
});
`
So… is something going wrong? Do I need to set up the event in the GA4 dashboard, or does GA4 auto-magically sort that out as soon as it gets the event? Has anyone else run into this, any advice?FYI, I chased the network traffic and sure enough, the data goes into the window.dataLayer array and even reaches GA4 sometimes. So what gives?
Log in to reply.