Backends
Server-rendered sites
For any server-rendered site, put Stickybeak in the shared layout and pass one-time server events to the next page.
<script
defer
data-site="YOUR_SITE_ID"
data-domain="example.com"
src="https://app.usestickybeak.com/_cfw/s.js"
></script>
The pattern
Keep production separate
Read the site ID from config and set it only in production. The ID is public; the check keeps staging traffic out.
Add the tag
Render it before
</head>in the layout every page shares.Queue browser goals
Place this above calls that may run before the deferred script loads:
<script>window.stickybeak = window.stickybeak || function () { (window.stickybeak.q = window.stickybeak.q || []).push(arguments); };</script>
Server-side goals and custom events
Goals (often called custom events or conversions) do not use a server-to-server event API in Stickybeak. Store the goal as a one-time session flash, redirect, then safely JSON-encode a browser call in the next page’s <head>:
<script>window.stickybeak("signup", { "plan": "pro" });</script>
Use your framework’s JSON or JavaScript encoder, not HTML escaping or raw user input.
If an event always ends on a unique thank-you path, create a page-visit goal under Manage goals instead. See Custom goals.
Revenue
Send revenue (or amount), currency and order_id from the confirmation page. Each order ID counts once.
<script>window.stickybeak("purchase", { "revenue": 49.5, "currency": "USD", "order_id": "1042" });</script>
See Revenue.
Common gotchas
localhostand iframe previews are not counted. Do Not Track and Global Privacy Control are.- Only the configured domain and its subdomains are accepted; keep subdomain staging behind the production check.
- Never put a flashed goal into a publicly cached response.
- A Content Security Policy must allow the external script, connections and any inline queue.
See Troubleshooting or Verify your install.
All backend guides
- OverviewAdd Stickybeak web analytics to any server-rendered site with one layout tag, production checks and conversion goals after redirects.
LaravelLaravel analytics with Stickybeak: add the script, track page views and goals, and set up Laravel visitor tracking on your live site.
RailsRails analytics with Stickybeak: add the script, track page views and goals, and compare it with Rails Google Analytics setups.
DjangoDjango analytics with Stickybeak: add the script, track page views and goals, and set up Django visitor tracking on your live site.
ExpressExpress analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
FlaskFlask analytics with Stickybeak: add the script, track page views and goals, and compare it with Flask Google Analytics setups.
FastAPIFastAPI analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
PhoenixPhoenix analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
SymfonySymfony analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
ASP.NET CoreASP.NET Core analytics with Stickybeak: add the script, track page views and goals, and compare it with ASP.NET Core Google Analytics setups.
Spring BootSpring Boot analytics with Stickybeak: add the script, track page views and goals, and compare it with Spring Boot Google Analytics setups.
GoGo analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
Plain PHPPlain PHP analytics with Stickybeak: add the script, track page views and goals, and set up PHP visitor tracking on your live site.
CodeIgniterCodeIgniter analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
WagtailWagtail analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
DrupalDrupal analytics with Stickybeak: add the script, track page views and goals, and use a lighter alternative to Google Analytics for Drupal.
Craft CMSCraft CMS analytics with Stickybeak: add the script, track page views and goals, and compare it with Craft CMS Google Analytics setups.
StatamicStatamic analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
MagentoMagento analytics with Stickybeak: add the script, track page views and goals, and use a lighter alternative to Google Analytics for Magento.
PrestaShopPrestaShop analytics with Stickybeak: add the script, track page views and goals, and compare it with PrestaShop Google Analytics setups.
OpenCartOpenCart analytics with Stickybeak: add the script, track page views and goals, and use a lighter alternative to Google Analytics for OpenCart.JoomlaJoomla analytics with Stickybeak: add the script, track page views and goals, and use a lighter alternative to Google Analytics for Joomla.
KirbyKirby analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
GravGrav analytics with Stickybeak: add the script, track page views and goals, and compare it with Grav Google Analytics setups.
UmbracoUmbraco analytics with Stickybeak: add the script, track page views and goals, and compare it with Umbraco Google Analytics setups.
- Headless CMSsUsing Strapi, Sanity, Contentful, Payload, Directus or Storyblok? Stickybeak goes in the frontend that renders your pages, not the CMS.
- Turbo, htmx and friendsHow Stickybeak counts page views with Turbo, htmx, Livewire, Inertia, LiveView and Blazor, and how to fire goals from partial page updates.
Cloudflare WorkersCloudflare Workers analytics with Stickybeak: add the script in the right layout, verify page views, and track goals and purchase revenue on your live site.
Nginx and ApacheNginx analytics with Stickybeak: add the script, track page views and goals, and compare it with Nginx Google Analytics setups.