# Site Analytics

So you want to know what your users have been up to...

Fortunately, dAppling has an analytics package to make configuring your site analytics quick and easy!

### Install dappling-analytics in your project

Add the [dappling-analytics package](https://github.com/alwaysbegrowing/dapplingAnalytics) as a module within your project's repository. This is a very simple package that tracks page views and unique users across your site.

#### Quickstart

1. Add the `dappling-analytics` package to your project

```bash
npm i dappling-analytics
yarn add dappling-analytics
```

2. Inject the Analytics component into your app by adding it to your project's root (make sure to import it from the react directory). This component injects a script into your app every time a page loads that tracks the page view and user information. The information is sent to and stored in dAppling's database and displayed in the `Analytics` tab of your project.

```
import { Analytics } from 'dappling-analytics/react'
```

3. Re-deploy your app to [dAppling](https://dappling.network) and see your garden growing.

#### Example

If you are using a Next.js project, import and add the `Analytics` component to your root.

```typescriptreact
import "./globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import { Analytics } from "dappling-analytics/react";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
  title: "Create Next App",
  description: "Generated by create next app",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body className={inter.className}>
        {children}
        <Analytics />
      </body>
    </html>
  );
}
```

When you push the changes to your main branch, the dAppling app should trigger a production deployment with your new changes. If a new deployment is not triggered, [**create a production deployment**](/legacy-docs/getting-started/create-deployments.md) **to deploy the analytics changes**.

Your site is now configured with site analytics and you can watch the views roll in!

#### Analytics Panel

To view your analytics, navigate to the project page on [dAppling.network](https://dappling.network) and select the 'analytics' tab. Here you can view the total number of page views for your entire site, the total number of users, the number of views per page, and your page views over time. Change the time frame for the analytics by using the dropdown menu in the top righthand corner of the page.

<figure><img src="/files/KnDcyRQzrsq04YdgqmPD" alt=""><figcaption></figcaption></figure>

:cactus:*Fun Fact: The Silene stenophylla, a type of campion flower, was grown from a 32,000-year-old seed discovered in Siberian permafrost.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dappling.network/legacy-docs/getting-started/site-analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
