-
Trouble excluding test data from Google Analytics 4 Realtime reports
“Hey there, I’m having a bit of a pickle here trying to debug GA4 without meddling with my data. I can’t seem to make it happen without deactivating my internal traffic filter, and then my doings on the app roll into the Realtime reports. It only seems to be showing up there for now, but my gut tells me it might pop up in all Reports after 48 hours.
Now, I’m wondering if behavior like this is typical? Is there something different about Realtime reporting? Does it pick up on dev traffic while the other reports turn a blind eye? If that’s the case, you can ignore the rest of my dilemma.
So far, I’ve tried using Google Chrome with this nifty GA debug extension [ga debugger ext](https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna) to examine my website on localhost. When my Internal Traffic filter is off and my Developer Traffic filter is on, my presence shows up on the Realtime reports (not cool). But I can see data in the debug view (nice). No data is revealed in either the Realtime reports area or the debug view when both filters are active (a bit of a catch-22).
Here’s some of my lovely code that I’m working with:
import ReactGA from "react-ga4"; function App() { useEffect(() => { ReactGA.initialize("G-blablabla"); ReactGA.send("pageview"); }, [] ) let location = useLocation(); useEffect(() => { ReactGA.send({ hitType: "pageview", page: location }); }, [location]); const GenerateAppRoutes = () => { return ( <> <Route path="/" element={ <Landing/> } /> <Route path="/blog/design" element={ <BlogPillar imgSrc={sampleImg} topicTitle='Design' articles={ [ {'link': '/blog/design/materials', 'title': 'Materials'}, {'link': '/blog/design/fasteners', 'title': 'Screws'}, ] } imgAlt="" /> }/> </> ) } const AppRoutes = GenerateAppRoutes(); const appRouteObjects = createRoutesFromChildren(AppRoutes); const GeneratedRoutes = useRoutes(appRouteObjects); return ( <> <NavBarComponent/> {GeneratedRoutes} </> ) } export default App;
Can someone out there help me figure this out? Any advice would be great! Cheers!”
Log in to reply.