Splitbee is a powerful analytics and conversion platform that is faster, easier to use, and more affordable than Google Analytics. In this tutorial, we will show you how to add Splitbee to your Next.js website, add a custom event, and create an automation using Notion. ## Prerequisites To follow along with this tutorial, you will need: * A Next.js website * A Splitbee account * A Notion account ## Getting Started First, we need to add Splitbee to our Next.js website. To do this, we need to copy and paste the following script tag into the `<head>` of our `index.js` file: ``` <script src="https://cdn.splitbee.com/js/splitbee.js"></script> ``` Once we have added the script tag, we need to create a Splitbee project. To do this, go to the [Splitbee website](https://www.splitbee.com/) and click the **Create Project** button. Enter a name for your project and click the **Create Project** button. ## Adding a Custom Event Now that we have Splitbee installed on our website, we can add a custom event. To do this, we need to add the following code to our `index.js` file: ``` import { useEffect } from "react"; const handleResumeView = () => { window.splitbee.track("resume-view"); }; export default function Home() { useEffect(() => { handleResumeView(); }, []); return ( <div> <h1>Welcome to Coffee Class</h1> <p>This is a tutorial website for learning programming.</p> <button onClick={handleResumeView}>View Resume</button> </div> ); } ``` This code will track the event `resume-view` whenever the user clicks the **View Resume** button. ## Creating an Automation Now that we have a custom event, we can create an automation. To do this, go to the **Automations** tab in the Splitbee dashboard and click the **Create Automation** button. Select the **Button Click** event and click the **Next** button. In the **Action** field, select the **Notion Database** integration. Click the **Connect** button and sign in to your Notion account. Once you have connected your Notion account, you will be able to select a Notion database. Click the **Next** button. In the **Data** field, enter the following code: ``` { "user_id": "{{user.id}}", "country": "{{user.country}}" } ``` This code will send the user ID and country of the user who triggered the automation to Notion. Click the **Next** button. In the **Run** field, select the **Run Once Per User** option. Click the **Create Automation** button. ## Testing the Automation Now that we have created an automation, we can test it. To do this, go to your website and click the **View Resume** button. You should see a new entry in your Notion database with the user ID and country of the user who triggered the automation.
What is the purpose of split b automations?
What is the benefit of using split b over google analytics?
What is the first step in creating a split b automation?
Previous