Kiki do you love me?

I thought about many different things to write about and I decided to choose a music video to write my first blog on. I wanted to use a music video that was recently released and popular. After…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Using Google Analytics with Next.js

The code snippet is pretty self-explanatory. It imports the react-ga module, wraps the boilerplate functionality as initialization with your selected account ID, and logging behind a simple API that we'll use in our React components.

Speaking of components, the next thing we’ll do is create our core layout component:

The output returned by the render function is just the child components wrapped in a div. The component does not add anything to the rendered HTML, all tracking is done via the Google Analytics JavaScript API using our wrapper utility and the ReactGA module.

To use the new component you’ll need to include it in an entrypoint. Create a simple page that extends our layout:

Add a comment

Related posts:

Wane

I cast all my blessings at the dark of the moon because everyone I know could use a new beginning, and it’s nice sometimes to be alone and be the only glow in the room. no one will ever know the…

Unlock Your Subconscious by Keeping a Dream Journal

Keeping a Dream Journal is a great way to get to know your own mind, and after a few months of diligent record keeping you will begin to read the symbols of your own subconscious like a very odd open…

Rev Rides Now Offering Electric Scooter Coupons

Have you ever seen a bloke riding in downtown on an electric scooter and just thought to yourself “wow, I want to be that guy”? Well, that’s probably because you didn’t know about Rev Rides electric…