Skip to content

Instantly share code, notes, and snippets.

@abedzantout
Created September 20, 2019 15:03
Show Gist options
  • Save abedzantout/4ea1598a078e70d1dd456185ec076d4b to your computer and use it in GitHub Desktop.
Save abedzantout/4ea1598a078e70d1dd456185ec076d4b to your computer and use it in GitHub Desktop.
import App from 'next/app';
import React from 'react';
import Router from 'next/router';
import {trackPageView} from '../core/gtag';
Router.events.on('routeChangeComplete', url => trackPageView(url));
class MyApp extends App {
render() {
const {Component, pageProps} = this.props;
return (
<React.Fragment>
<Component {...pageProps} />
</React.Fragment>
);
}
}
export default MyApp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment