Flask apps are small by design, and Reveata keeps it that way: one tag in a template, and, if you want first-party serving, two routes. No extension to install.
What you get
- Every page rendered from your base template, tracked with source, campaign and device.
- First-party serving through two Flask routes that pass the visitor's address with your proxy secret, so fewer visits are lost to ad blockers.
- Revenue credited to visits from checkouts your routes create.
- Your own billing sent to the Payments API from Python.
How to install it
- Open the base template in your
templatesfolder, oftentemplates/base.htmlorlayout.html. - Paste the snippet before
</head>and deploy. - Pages rendered from templates that don't extend the base need the snippet too.
Jinja inheritance in Flask is described in Flask's templating docs (opens in a new tab).
Linking payments to visits
Connect your payment provider, then add two hidden fields to the form with your buy button, filled from window.reveata.metadata(). In the route that creates the Stripe Checkout Session, copy them into its metadata:
metadata = {k: v for k, v in {
"reveata_visitor_id": request.form.get("reveata_visitor_id"),
"reveata_session_id": request.form.get("reveata_session_id"),
}.items() if v}The route can also read the _dt_v and _dt_s cookies from request.cookies and keep the part before the first dot (Stripe Checkout attribution). If Reveata doesn't connect to your provider, post each payment to the Payments API with a website key, the transactionId, amount, currency, email and the saved visitorId.
Serving the script from your own domain
| Setup | Guide |
|---|---|
| Flask serves everything | Proxy with Flask: two routes |
| NGINX or Caddy in front | NGINX or Caddy |
| No server changes | The managed proxy: one DNS record |
Whatever you choose, the proxy must send the visitor's address with your website's proxy secret, or every visit looks as if it came from your server.