> For the complete documentation index, see [llms.txt](https://docs.humblytics.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.humblytics.com/how-to-get-started/laravel.md).

# Laravel

Add Humblytics to your Laravel site in about 5 minutes.

{% hint style="info" %}
**You need:** access to your Blade layout and a production deploy. `localhost` won't verify.
{% endhint %}

## 1. Copy your tracking code

In Humblytics, open **Site settings → Install** and click **Copy tracking code**.

## 2. Add it to your Blade layout

Paste the snippet just before `</head>` in the layout every page uses, usually `resources/views/layouts/app.blade.php`.

**Only want it in production?** Wrap the snippet in Blade's environment check:

```blade
@production
  <!-- paste your Humblytics snippet here -->
@endproduction
```

Several layouts? Move the snippet into a partial, such as `resources/views/partials/humblytics.blade.php`, and add `@include('partials.humblytics')` to each layout's `<head>`.

<figure><img src="https://1281224403-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqZMBn2D7F1lV2hgGTS2X%2Fuploads%2FsQRHdaMtK6sUwA0lxuJw%2Fcustom%20code%20script.gif?alt=media&amp;token=670adf7b-a09d-4d95-888d-848e32016dca" alt=""><figcaption></figcaption></figure>

## 3. Deploy and verify

1. Deploy to production. If you cache views, run `php artisan view:clear`.
2. Back in Humblytics, click **Verify install**.
3. Open your live site in a private window and click around. Your visit appears in **Observe → Analytics → Overview** under **Live Activity** within about a minute.

**Not verifying?** Check that `APP_ENV=production` on the server if you used `@production`, and that every page uses a layout with the snippet.

Still stuck? See [Verify & Troubleshoot Tracking](/how-to-get-started/verify-and-troubleshoot-tracking.md).
