Content


HomeSnippetsLearnTutorialsTagsSearch
splitbee.png

Add Splitbee Analytics To Next.js

Track your users with ease.

Tracking analytics has never been easier.

1

Register

Navigate to https://splitbee.io/ and sign up for a free account (no credit card required).

2

Add The Tracking Tag

Add the folling tag to the head of your website. In Next.js this is inside of _document.js.

<script async src="https://cdn.splitbee.io/sb.js"></script>
_document.js
import NextDocument, { Html, Head, Main, NextScript } from 'next/document'

export default class MyDocument extends NextDocument {
    render() {
        return (
            <Html lang="en">
                <Head>
                    {/* Splitbee Analytics */}
                    <script async src="https://cdn.splitbee.io/sb.js"></script>
                </Head>
                <body>
                    <Main />
                    <NextScript />
                </body>
            </Html>
        )
    }
}
3

Go To Your Site

Navigate to your site and you should see analytics flow through your dashboard!

4

Advanced Usage

To get the most out of Splitbee, the Splitbee team recommends looking into event tracking and storing user properties. They allow you to do things like:

  • Track conversion events
  • Capture form data and attach it to a user
  • Assign data to a user, like their email address

Happy tracking!


Published on July 20, 2021 in

#splitbee

Written By Benjamin Carlson

Founder Coffeeclass

More Articles By Benjamin Carlson


Legal

Terms

Disclaimer

Privacy Policy

Content
© Copyright 2021, Carlson Technologies LLC. All Rights Reserved.

Powered by

Vercel Logo