Laravel apps that charge customers usually do it with Laravel Cashier (opens in a new tab) on Stripe. That is good news for attribution: Cashier's checkout accepts metadata, and that is all Reveata needs.
What you get
- Every page tracked, Blade or Inertia. Inertia page changes go through the History API, which the script follows.
- Production only, if you like. Wrap the snippet in Blade's
@productiondirective so local and staging traffic never reaches your numbers. - Stripe payments credited to visits, one-off or subscription, through Cashier's checkout metadata.
- MRR by channel from your Stripe subscriptions (Stripe subscription analytics).
How to install it
- Open the layout your pages use, usually
resources/views/layouts/app.blade.php. Starter kits also havelayouts/guest.blade.phpfor sign-in pages; with Inertia, use the root template, usuallyresources/views/app.blade.php. - Paste the snippet before
</head>, inside@production…@endproductionif you want it in production only. - Deploy. If you cache views, run
php artisan view:cacheagain.
Linking payments to visits
Add two hidden fields to the form with your buy button, filled from window.reveata.metadata(). Then pass them as the Checkout Session's metadata:
return $request->user()->checkout(['price_123' => 1], [
'success_url' => route('thanks'),
'metadata' => array_filter($request->only(['reveata_visitor_id', 'reveata_session_id'])),
]);For subscriptions, use newSubscription('default', 'price_123')->checkout([...]) with the same metadata; renewals then keep the first payment's source. Connect the same Stripe account in Reveata first (Stripe Checkout attribution).
If you bill another way, post payments to the Payments API with a site key stored in config/services.php.
Serving the script from your own domain
Two routes in routes/web.php can proxy the script and events (the Laravel section of proxy through your own server). Store the secret as REVEATA_PROXY_SECRET and read it through config(), so it survives php artisan config:cache. Forge and most servers run NGINX in front, which can proxy instead (NGINX).