on-internet
← Community

Send a new config to gtag when a new "page" is loaded in an SPA does not show the new path in realtime analytics

Stack Overflow ·

I'm using React SPA. When I use gtag to track users in Google Analytics, I am confused about the data that I see in Real-Time Google Analytics. When the app starts or the user is routed to a new react route, I fired an event like this to set the correct page and log pageView: window.gtag('config', UA-123456789-1, { groups: 'MYGROUP', page_path: '/contacts', }) When the user clicks on the button or makes some interesting action I fire an event like this: window.gtag('event', 'Some button click', { sendTo: 'MYGROUP', event_category: 'buttons on main page', }) Many events are button clicks on pag

Comments

Sign in or sign up to comment and upvote.

No comments yet.