import Document, { Main, NextScript } from 'next/document' import { useAmp } from 'next/amp' import { GA_TRACKING_ID } from '../lib/gtag' import AmpAnalytics from '../components/amp/AmpAnalytics' function AmpWrap({ ampOnly, nonAmp }) { const isAmp = useAmp() if (ampOnly) return isAmp && ampOnly return !isAmp && nonAmp } export default class MyDocument extends Document { render() { return (
{/* AMP - Google Analytics */} } /> {/* Non-AMP - Google Analytics */}