Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App router migration analytics #1123

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Analytics from '../components/head/Analytics';
import GoogleTagManagerScript from '../components/head/GoogleTagManagerScript';
import ErrorBoundary from '../components/layout/ErrorBoundary';

Check failure on line 3 in app/layout.tsx

View workflow job for this annotation

GitHub Actions / build-and-test

Duplicate identifier 'rootMetadata'.
import rootMetadata from './rootMetadata';
import RollbarScript from '../components/head/RollbarScript';
import ThemeRegistry from './ThemeRegistry';

Check failure on line 6 in app/layout.tsx

View workflow job for this annotation

GitHub Actions / build-and-test

Duplicate identifier 'rootMetadata'.
import rootMetadata from './rootMetadata';

export const metadata = rootMetadata;

Expand All @@ -26,6 +26,7 @@
<ErrorBoundary>
<ThemeRegistry>{children}</ThemeRegistry>
</ErrorBoundary>
<Analytics />
</body>
</html>
);
Expand Down
13 changes: 13 additions & 0 deletions components/head/Analytics.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Analytics as VercelAnalytics } from '@vercel/analytics/react';
import { Hotjar } from 'nextjs-hotjar';

export default function Analytics() {
return (
<>
{!!process.env.NEXT_PUBLIC_HOTJAR_ID && process.env.NEXT_PUBLIC_ENV !== 'local' && (
<Hotjar id={process.env.NEXT_PUBLIC_HOTJAR_ID} sv={6} strategy="lazyOnload" />
)}
<VercelAnalytics />
</>
);
}
Loading