50 lines
No EOL
1.5 KiB
JavaScript
Executable file
50 lines
No EOL
1.5 KiB
JavaScript
Executable file
// import App from 'next/app'
|
|
import "@fortawesome/fontawesome-free/css/all.min.css";
|
|
import 'bootstrap-css-only/css/bootstrap.min.css';
|
|
import 'mdbreact/dist/css/mdb.css';
|
|
import { Fragment, useEffect } from 'react';
|
|
import "../components/css/styles.css"
|
|
import { Router, useRouter } from 'next/router'
|
|
|
|
//Router.events.on('routeChangeComplete', (url) => gtag.pageview(url))
|
|
|
|
import { init } from "@socialgouv/matomo-next";
|
|
|
|
const MATOMO_URL = "https://analytics.angrybeanie.com";
|
|
const MATOMO_SITE_ID = 2;
|
|
|
|
console.log(MATOMO_URL);
|
|
|
|
function MyApp({ Component, pageProps }) {
|
|
const router = useRouter()
|
|
useEffect(() => {
|
|
const handleRouteChange = (url) => {
|
|
// gtag.pageview(url);
|
|
// console.log("Pageview is happening")
|
|
};
|
|
init({ url: MATOMO_URL, siteId: MATOMO_SITE_ID });
|
|
router.events.on("routeChangeComplete", handleRouteChange);
|
|
return () => {
|
|
router.events.off("routeChangeComplete", handleRouteChange);
|
|
};
|
|
}, [router.events]);
|
|
|
|
|
|
return (
|
|
<Component {...pageProps} />
|
|
)
|
|
}
|
|
|
|
// Only uncomment this method if you have blocking data requirements for
|
|
// every single page in your application. This disables the ability to
|
|
// perform automatic static optimization, causing every page in your app to
|
|
// be server-side rendered.
|
|
//
|
|
// MyApp.getInitialProps = async (appContext) => {
|
|
// // calls page's `getInitialProps` and fills `appProps.pageProps`
|
|
// const appProps = await App.getInitialProps(appContext);
|
|
//
|
|
// return { ...appProps }
|
|
// }
|
|
|
|
export default MyApp |