> For the complete documentation index, see [llms.txt](https://docs.sitebehaviour.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sitebehaviour.com/guides-and-integrations/nextjs.md).

# NextJS

&#x20;Here are the steps for users to add your web analytics script to their Next.js project :&#x20;

### Steps to Add Script to a Next.js Project

1. Go to your SiteBehaviour Organisation's page and click on the **Settings button** for your site.
2. Go to the Tracking code tab.
3. Click on **Copy** to copy the Tracking Code to your clipboard.
4. In your Next.js project directory, find the `pages` folder. This folder contains the main entry point for your application, such as `_app.js` or `_app.tsx`.
5. Open the `_app.js` (or `_app.tsx` if you're using TypeScript) file in the `pages` folder.
6. At the top of your `_app.js` or `_app.tsx` file, import the `Head` component from `next/head`.

```
import Head from 'next/head';
```

&#x20;7 . Add the `Head` component to your custom App component and place your SiteBehaviour   script inside it.

```
// _app.js
import Head from 'next/head';
import '../styles/globals.css';

function MyApp({ Component, pageProps }) {
    return (
        <>
            <Head>
                <script>
                    {`
                        // Your sitebehaviour tracking script here
                    `}
                </script>
            </Head>
            <Component {...pageProps} />
        </>
    );
}

export default MyApp;

```
