Skip to content
Open
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
28 changes: 15 additions & 13 deletions components/js/google/analytics.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
import Safe from 'react-safe';

import Head from 'next/head';
import Script from 'next/script';

export function GoogleAnalytics(props) {
const gtagJS = `
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());

gtag('config', '${props.trackingId}');
`;

return (
<>
<Head>
Expand All @@ -24,8 +13,21 @@ gtag('config', '${props.trackingId}');
}
key="google-analytics"
></script>
<Safe.script>{gtagJS}</Safe.script>
</Head>
<Script
id="google-analytics-config"
strategy="afterInteractive"
dangerouslySetInnerHTML={{
__html: `
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', '${props.trackingId}');
`,
}}
/>
</>
);
}
4 changes: 4 additions & 0 deletions constants/nav_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const NAV_LINKS = [
name: 'Projects',
url: '/projects',
},
{
name: 'Docs',
url: '/docs',
},
{
name: 'Community',
url: '/community',
Expand Down
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ module.exports = {
'/community': { page: '/community' },
'/contact': { page: '/contact' },
'/projects': { page: '/projects' },
'/docs': { page: '/docs' },
'/docs/getting-started': { page: '/docs/getting-started' },
'/docs/modules': { page: '/docs/modules' },
'/docs/api': { page: '/docs/api' },
};
},
};
Loading