禁用谷歌分析,没啥用

This commit is contained in:
sijinhui 2024-09-06 18:00:58 +08:00
parent 7636a82d5d
commit 688049839e

View File

@ -6,7 +6,7 @@ import { getClientConfig } from "./config/client";
import type { Metadata, Viewport } from "next"; import type { Metadata, Viewport } from "next";
import { SpeedInsights } from "@vercel/speed-insights/next"; import { SpeedInsights } from "@vercel/speed-insights/next";
import { getServerSideConfig } from "./config/server"; import { getServerSideConfig } from "./config/server";
import { GoogleTagManager, GoogleAnalytics } from "@next/third-parties/google"; import { GoogleTagManager } from "@next/third-parties/google";
const serverConfig = getServerSideConfig(); const serverConfig = getServerSideConfig();
import { Providers } from "@/app/providers"; import { Providers } from "@/app/providers";
// import { Viewport } from "next"; // import { Viewport } from "next";
@ -87,16 +87,16 @@ export default function RootLayout({
<SpeedInsights /> <SpeedInsights />
</> </>
)} )}
{serverConfig?.gtmId && ( {/*{serverConfig?.gtmId && (*/}
<> {/* <>*/}
<GoogleTagManager gtmId={serverConfig.gtmId} /> {/* <GoogleTagManager gtmId={serverConfig.gtmId} />*/}
</> {/* </>*/}
)} {/*)}*/}
{serverConfig?.gaId && ( {/*{serverConfig?.gaId && (*/}
<> {/* <>*/}
<GoogleAnalytics gaId={serverConfig.gaId} /> {/* <GoogleAnalytics gaId={serverConfig.gaId} />*/}
</> {/* </>*/}
)} {/*)}*/}
</body> </body>
</html> </html>
); );