About five minutes, on the free plan, without a credit card.
1
Paste two script tags into your <head>
Works on anything you can edit a template for: a static site, an Astro or Hugo build, a CMS theme, a single index.html. Replace YOUR_CLIENT_ID with the client id from your Privytics project. Setting apiUrl is required. Leave it out and the SDK sends events to OpenPanel's hosted API instead of yours.
<script>
window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();
window.op('init', {
apiUrl: 'https://api.privytics.com',
clientId: 'YOUR_CLIENT_ID',
trackScreenViews: true,
trackOutgoingLinks: true,
trackAttributes: true,
});
</script>
<script src="https://privytics.com/op1.js" defer async></script>
2
Pick five events and name them properly
With 10,000 events a month you have room for roughly 10,000 page views, or fewer once custom events are added, so spend them on the handful of moments that tell you whether the project works. Use lowercase snake_case verbs in the past tense, keep the name stable, and push the variable part into properties instead of into the event name. Two events called checkout_started_pro and checkout_started_free cannot be counted together later. One checkout_started with a plan property can.
// The moment someone gets past the landing page
window.op('track', 'signup_started', {
source: 'hero_cta',
});
window.op('track', 'signup_completed', {
plan: 'free',
});
// The moment they actually use the thing
window.op('track', 'project_created', {
template: 'blank',
});
window.op('track', 'export_downloaded', {
format: 'csv',
});
// The moment money is involved
window.op('track', 'checkout_started', {
plan: 'pro',
interval: 'monthly',
});
3
Track clicks from markup, without writing JavaScript
You enabled trackAttributes in step one, so any button or anchor carrying data-track fires that event on click. Every other data-* attribute on the element is sent as an event property. Useful when the side project is a landing page and a form, and you do not want a JS file just for analytics.
<button
data-track="checkout_started"
data-plan="pro"
data-interval="monthly"
>
Upgrade
</button>