Plenty of profitable sites are plain PHP: a header.php, a few pages, a checkout.php. Reveata fits that shape exactly, with no framework, no Composer package for tracking and no build step.
What you get
- Every page tracked from one shared header.
- First-party serving from two small PHP files that pass the visitor's address with your proxy secret.
- Payments credited to visits, from the metadata your checkout script adds.
- Your own billing posted to the Payments API with a website key.
How to install it
- Open the file that prints
<head>, for example theheader.phpyouincludeat the top of each page (PHP's include documentation (opens in a new tab)). - Paste the snippet before
</head>and upload the file. - Pages that don't share the header need the snippet pasted in themselves.
For WordPress, use the plugin instead (WordPress analytics). For Laravel, see Laravel analytics.
Linking payments to visits
Add two hidden fields to the form with your buy button, filled from window.reveata.metadata() when the form is sent. In checkout.php, copy them into the Checkout Session's metadata with stripe/stripe-php, or read Reveata's cookies directly:
<?php
function reveata_id(string $cookie): ?string {
$id = explode('.', $_COOKIE[$cookie] ?? '')[0];
return preg_match('/^[a-z0-9]{8,64}$/', $id) ? $id : null;
}
$metadata = array_filter([
'reveata_visitor_id' => $_POST['reveata_visitor_id'] ?? reveata_id('_dt_v'),
'reveata_session_id' => $_POST['reveata_session_id'] ?? reveata_id('_dt_s'),
]);Keep checkout.php free of output before header(), or the redirect to Stripe fails. More in Stripe Checkout attribution. If Reveata doesn't connect to your provider, send each payment to the Payments API.
Serving the script from your own domain
| Hosting | Option |
|---|---|
| Any PHP host, shared hosting included | Proxy with plain PHP |
| You manage the web server | NGINX or Caddy |
| No server changes at all | The managed proxy, one DNS record |