Add Antlytics to Laravel
Prerequisites
- An Antlytics account (sign up free)
- Your tracking ID from Settings → Tracking Snippet in your Antlytics dashboard
Install the snippet
Open your primary Blade layout — typically resources/views/layouts/app.blade.php — and paste the snippet just before the closing </head> tag:
{{-- resources/views/layouts/app.blade.php --}}
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ config('app.name', 'Laravel') }}</title>
@vite(['resources/css/app.css', 'resources/js/app.js'])
<script
defer
src="https://www.antlytics.com/tracker.js"
data-tracking-id="YOUR-SITE-ID"
data-api-host="https://www.antlytics.com"
></script>
</head>
<body>
@yield('content')
</body>
</html>
Note: Replace
YOUR-SITE-IDwith the tracking ID from your Antlytics dashboard.
If your project uses a different layout name or Livewire, add the snippet to whichever Blade file wraps every user-facing page.
Verify installation
- Visit your site in a browser.
- Open your Antlytics dashboard → Overview.
- Your visit should appear within a few seconds.
If data does not appear after a few minutes, check the troubleshooting guide.
Optional: First-party proxy
To avoid ad blockers, set up a first-party proxy on your own domain.
Need help?
Email support@antlytics.com with your site ID and page URL.
Something missing? Get in touch and we will update these docs.