-
+
()
+ROUTE_MANIFEST_END */
diff --git a/src/router.tsx b/src/router.tsx
index 800eab1b..943bf41c 100644
--- a/src/router.tsx
+++ b/src/router.tsx
@@ -6,6 +6,7 @@ import { routeTree } from './routeTree.gen'
import { DefaultCatchBoundary } from './components/DefaultCatchBoundary'
import { NotFound } from './components/NotFound'
import { QueryClient } from '@tanstack/react-query'
+import { GamOnPageChange } from './components/Gam'
export function createRouter() {
const CONVEX_URL =
@@ -49,15 +50,16 @@ export function createRouter() {
queryClient
)
+ let firstRender = true
+
router.subscribe('onResolved', () => {
- try {
- ;(window as any)._carbonads?.refresh?.()
- document.querySelectorAll('[id^="carbonads_"]').forEach((el, i) => {
- if (i > 0) {
- el.remove()
- }
- })
- } catch {}
+ if (firstRender) {
+ firstRender = false
+ return
+ }
+
+ console.log('onResolved')
+ GamOnPageChange()
})
return router
diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx
index 7a2b4335..ebf099c0 100644
--- a/src/routes/__root.tsx
+++ b/src/routes/__root.tsx
@@ -20,7 +20,7 @@ import { NotFound } from '~/components/NotFound'
import { CgSpinner } from 'react-icons/cg'
import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
import { getThemeCookie, useThemeStore } from '~/components/ThemeToggle'
-import { GoogleScripts } from '~/components/GoogleScripts'
+import { GamScripts } from '~/components/Gam'
import { BackgroundAnimation } from '~/components/BackgroundAnimation'
import { SearchProvider } from '~/contexts/SearchContext'
import { SearchModal } from '~/components/SearchModal'
@@ -45,10 +45,6 @@ export const Route = createRootRouteWithContext<{
keywords:
'tanstack,react,reactjs,react query,react table,open source,open source software,oss,software',
}),
- {
- name: 'google-adsense-account',
- content: 'ca-pub-9403278435468733',
- },
],
links: [
{ rel: 'stylesheet', href: appCss },
@@ -187,7 +183,7 @@ function RootDocument({ children }: { children: React.ReactNode }) {
{matches.find((d) => d.staticData?.baseParent) ? (
) : null}
-
+
diff --git a/src/routes/_libraries/index.tsx b/src/routes/_libraries/index.tsx
index deba766b..42e1e79c 100644
--- a/src/routes/_libraries/index.tsx
+++ b/src/routes/_libraries/index.tsx
@@ -13,7 +13,7 @@ import { partners } from '../../utils/partners'
import OpenSourceStats from '~/components/OpenSourceStats'
import splashLightImg from '~/images/splash-light.png'
import splashDarkImg from '~/images/splash-dark.png'
-import { GadFooter } from '~/components/GoogleScripts'
+import { GamFooter } from '~/components/Gam'
import LandingPageGad from '~/components/LandingPageGad'
import { MaintainerCard } from '~/components/MaintainerCard'
import { coreMaintainers } from '~/libraries/maintainers'
diff --git a/src/routes/stats/npm/index.tsx b/src/routes/stats/npm/index.tsx
index ba98a8f1..2f1e8415 100644
--- a/src/routes/stats/npm/index.tsx
+++ b/src/routes/stats/npm/index.tsx
@@ -21,10 +21,10 @@ import { HexColorPicker } from 'react-colorful'
import { seo } from '~/utils/seo'
import { getPopularComparisons } from './-comparisons'
import {
- GadFooter,
- GadLeftRailSquare,
- GadRightRailSquare,
-} from '~/components/GoogleScripts'
+ GamFooter,
+ GamLeftRailSquare,
+ GamRightRailSquare,
+} from '~/components/Gam'
import { twMerge } from 'tailwind-merge'
import logoColor100w from '~/images/logo-color-100w.png'
import {
@@ -2169,20 +2169,20 @@ function RouteComponent() {