问题描述
react.js Google分析无法正常工作。没有显示实时数据。我也在使用Firebase数据库 需要一些帮助
从“ react-ga”导入ReactGA;
function App() {
useEffect(() => {
ReactGA.initialize('G-6R4D4957DM');
// To Report Page View
ReactGA.pageview(window.location.pathname + window.location.search);
},[])
useEffect(() => {
console.log(window.location.pathname)
})
return (
<>
<ThemeProvider theme={Theme}>
<Navbar/>
<Switch>
{/* <Route exact path="/" component={Home}/> */}
<Route exact path="/" component={Properties} className="Properties"/>
<Route exact path="/sinnerthedog2Login/" component={Adminindex} />
<Route exact path="/sinnerthedog2/" component={AdminPannel} className="Properties"/>
<Route exact path="/:slug" component={Singlepage}/>
{/* <Route exact path="/sinnerthedog2/" component={AdminPannel}/> */}
<Route component={Error}/>
</Switch>
</ThemeProvider>
</>
);
}
export default App;
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)