Installation Guide

Laravel

Add ChurnFast tracking to your Laravel application using Blade templates. Works with traditional server-rendered apps, Inertia, and Livewire.

Blade templates

1

Add the script to your layout

Add the tracking script to your main Blade layout before the closing </head> tag:

resources/views/layouts/app.blade.php
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    @vite(['resources/css/app.css', 'resources/js/app.js'])

    <script
        src="https://yourapp.churnfa.st/e/app.js"
        data-site="YOUR_SITE_ID"
        data-email="{{ auth()->user()?->email }}">
    </script>
</head>
html

Note

The data-email attribute uses Laravel's auth() helper to inject the logged-in user's email. The email is hashed client-side via SHA-256 before being sent.
2

Verify installation

Visit your app as a logged-in user, then check ChurnFast's Integrations page. Click Verify Installation to confirm the script is detected.

Inertia.js (React / Vue)

If you're using Inertia, add the script to your root Blade template. The script automatically tracks SPA navigation — no additional setup is needed.

resources/views/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">
    @vite(['resources/css/app.css', 'resources/js/app.tsx'])
    @inertiaHead

    <script
        src="https://yourapp.churnfa.st/e/app.js"
        data-site="YOUR_SITE_ID"
        data-email="{{ auth()->user()?->email }}">
    </script>
</head>
<body>
    @inertia
</body>
</html>
html

Note

Since Inertia uses history.pushState for navigation, all route changes are tracked automatically.

Livewire

For Livewire apps, the same Blade installation works perfectly. Livewire uses history.pushState for navigation, so all page changes are tracked automatically.

Environment-based loading

Only load the tracking script in production:

@production
    <script
        src="https://yourapp.churnfa.st/e/app.js"
        data-site="YOUR_SITE_ID"
        data-email="{{ auth()->user()?->email }}">
    </script>
@endproduction
html

Next steps