mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-18 08:26:35 +00:00
Add Matomo Tracking Script (#685)
This commit is contained in:
14
src/components/Matomo.jsx
Normal file
14
src/components/Matomo.jsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import Script from "next/script";
|
||||||
|
|
||||||
|
export function MatomoTagManager() {
|
||||||
|
return (
|
||||||
|
<Script id="matomo-tag-manager" strategy="afterInteractive">
|
||||||
|
{`var _mtm = window._mtm = window._mtm || [];
|
||||||
|
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
|
||||||
|
(function() {
|
||||||
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
|
g.async=true; g.src='https://cdn.matomo.cloud/netbird.matomo.cloud/container_hvVzPZGH.js'; s.parentNode.insertBefore(g,s);
|
||||||
|
})();`}
|
||||||
|
</Script>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ import 'react-toastify/dist/ReactToastify.css';
|
|||||||
import {dom} from "@fortawesome/fontawesome-svg-core";
|
import {dom} from "@fortawesome/fontawesome-svg-core";
|
||||||
import {AnnouncementBannerProvider} from "@/components/announcement-banner/AnnouncementBannerProvider";
|
import {AnnouncementBannerProvider} from "@/components/announcement-banner/AnnouncementBannerProvider";
|
||||||
import {ImageZoom} from "@/components/ImageZoom";
|
import {ImageZoom} from "@/components/ImageZoom";
|
||||||
|
import {MatomoTagManager} from "@/components/Matomo";
|
||||||
|
|
||||||
function onRouteChange() {
|
function onRouteChange() {
|
||||||
useMobileNavigationStore.getState().close()
|
useMobileNavigationStore.getState().close()
|
||||||
@@ -27,6 +28,7 @@ export default function App({ Component, pageProps }) {
|
|||||||
let tableOfContents = collectHeadings(pageProps.sections)
|
let tableOfContents = collectHeadings(pageProps.sections)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<MatomoTagManager />
|
||||||
<Head>
|
<Head>
|
||||||
<style>{dom.css()}</style>
|
<style>{dom.css()}</style>
|
||||||
{router.route.startsWith('/ipa') ?
|
{router.route.startsWith('/ipa') ?
|
||||||
|
|||||||
Reference in New Issue
Block a user