TechnicalJun 25, 2023Evergreen
Adding Google Analytics to a Next.js blog the old-fashioned way
First instrumentation on the blog: a gtag wrapper in lib/ga.js, a custom pages/_document.js with the Global Site Tag, and no npm dependency.
Tag
2 posts in my garden · read my essays
First instrumentation on the blog: a gtag wrapper in lib/ga.js, a custom pages/_document.js with the Global Site Tag, and no npm dependency.
Universal Analytics is on the way out, so this PR migrates to GA4 via Google Tag Manager loaded through next/script, and renames everything from stevieismagic.com to steven.ocampo.io.