# Analytics

### Internal Analytics

1. Create your account on [PostHog](https://posthog.com)
2. Get your API key in Settings > Personal API keys
3. Fill the the key in your `.env` file:

{% code title=".env" %}

```bash
NEXT_PUBLIC_POSTHOG_KEY=
```

{% endcode %}

### Stats Showcasing

{% hint style="info" %}
Showcasing your analytic stats allows your customers to be sure that your site has an interesting reach.
{% endhint %}

1. Create a Dashboard on PostHog (Website Metrics is fine to start with)
2. Click on the Share button on the top right corner
3. Check the "Share dashboard publicly" box
4. Copy the "Embed dashboard" code into your .env file:

{% code title=".env" %}

```bash
NEXT_PUBLIC_POSTHOG_IFRAME_URL=
```

{% endcode %}

<figure><img src="https://865796172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FntKe5sSLfvbHfpqI4xbm%2Fuploads%2FiZyCNrqkpsw2TxeLf3h9%2FCapture%20d%E2%80%99%C3%A9cran%202024-06-14%20132539.png?alt=media&#x26;token=362283b1-b877-4db5-8e48-e62a89238456" alt=""><figcaption></figcaption></figure>

#### Your visitors have now access to your Analytics Dashboard with the newly added "Stats" link on the Navbar.
