Laravel
Wazlytics drops into a Laravel app with one snippet in your layout’s <head> — no package to install. It works the same whether your pages are plain Blade, Livewire, or Inertia.
1. Get your snippet
Each site has its own snippet with a unique script URL. Copy the exact one from your dashboard’s Install step — it looks like this, with your site’s ID in place of wa-XXXXXXXX:
<!-- Privacy-friendly analytics by Wazlytics -->
<script async src="https://wazlytics.com/js/wa-XXXXXXXX.js"></script>
<script>
window.wazlytics = window.wazlytics || function(){(wazlytics.q = wazlytics.q || []).push(arguments)};
wazlytics.init = wazlytics.init || function(o){ wazlytics.o = o || {} };
wazlytics.init()
</script>2. Add it to your layout
Paste the snippet into the <head> of your main layout so it loads on every page. In most apps that’s resources/views/components/layouts/app.blade.php (Blade components) or resources/views/layouts/app.blade.php (a traditional @extends layout):
{{-- resources/views/components/layouts/app.blade.php --}}
<head>
{{-- …your existing meta, title, and asset tags… --}}
<!-- Privacy-friendly analytics by Wazlytics -->
<script async src="https://wazlytics.com/js/wa-XXXXXXXX.js"></script>
<script>
window.wazlytics = window.wazlytics || function(){(wazlytics.q = wazlytics.q || []).push(arguments)};
wazlytics.init = wazlytics.init || function(o){ wazlytics.o = o || {} };
wazlytics.init()
</script>
</head>Add it once to the shared layout — not to individual page views — so you don’t load the tracker twice.
Inertia and Livewire
Both navigate with the browser’s History API, and Wazlytics tracks those route changes automatically — so Inertia visits and Livewire wire:navigate links each record a pageview with no extra code. Because the snippet lives in the layout, it loads once and keeps working across SPA-style navigation. See Single-page apps for the details.
Note
livewire:navigated event:document.addEventListener('livewire:navigated', () => wazlytics('pageview'))Tip
@production directive, so it only renders when APP_ENV=production:@production
{{-- Wazlytics snippet --}}
@endproductionTrack custom events
Call wazlytics() from any Blade page, Alpine component, or your JavaScript to record signups, form submissions, and other actions:
wazlytics('Signup', { props: { plan: 'pro' } })You can also tag an element with data-waz-event instead of writing JavaScript. The tracking script reference covers the full event API, manual tagging, and 404 tracking.
Verify
Deploy or serve your app, open Realtime in Wazlytics, and load a page — your visit should appear within a few seconds. If nothing shows up, the troubleshooting guide covers the usual causes.