9/10/2021

Fusion Power is Cool!

This marketing blurb of this startup + MIT is super super super cool! But then after that….my immediate question: What’s the downside? There’s always cause/effect. action / reaction. Punch a hole in the universe? Demagnetize the poles? Do all birds migrate to fusion power plants instead of where they’re supposed to go? 😆

Revamped Fish.Management

3c7010861de77ce2cc495dc43d0384f0.png

If you’re using GA with NextJS

Because of the mix of static / server side / dynamic page options in a NextJS app, you have to handle Google Analytics in a specific way. It’s simple though: Create a _document.ts file in /pages/ like so:

import Document, { Html, Head, Main, NextScript } from 'next/document'

export default class MyDocument extends Document {
    render() {
        return (
            <Html>
                <Head>
                    {/* Global Site Tag (gtag.js) - Google Analytics */}
                    <script
                        async
                        src={`https://www.googletagmanager.com/gtag/js?id=UA-YOUR_TAG_HERE-1`}
                    />
                    <script
                        dangerouslySetInnerHTML={{
                            __html: `
                                window.dataLayer = window.dataLayer || [];
                                function gtag(){dataLayer.push(arguments);}
                                gtag('js', new Date());
                                gtag('config', 'UA-YOUR_TAG_HERE-1', {
                                    page_path: window.location.pathname,
                                });
                                gtag('config', 'G-YOUR_TAG_HERE');
                            `,
                        }}
                    />
                </Head>
                <body>
                    <Main />
                    <NextScript />
                </body>
            </Html>
        )
    }
}

Snorkeling during lunch breaks has been great this time of year…

9a39fbd3332484a6e63f52a963b21736.jpeg

This is an archived post, some things might not display right.

Copyright © Rick BlalockView Archive