About five minutes, on the free plan, without a credit card.
1
Paste the script tag into your one HTML file
Put both tags in the <head> of index.html, or in the root layout if your generator produced a framework app. Replace YOUR_CLIENT_ID with the client id from your Privytics project. Setting apiUrl is required: leave it out and the SDK sends your events to OpenPanel's hosted API instead of yours. With trackScreenViews on, page views start arriving on the next load and client-side route changes are picked up too. The global is called window.op and the file is op1.js because Privytics runs on the open-source OpenPanel engine and uses its official SDKs unchanged. Privytics is independent and is not affiliated with, endorsed by or sponsored by OpenPanel.
<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,
});
</script>
<script src="https://privytics.com/op1.js" defer async></script>
2
Put every event in one file
This is the step that decides whether the data is still useful in three months. Define the events once, in one module, and let the rest of the app import from it. Nothing else calls window.op directly. Keep it to five or ten events, name them object_verb in snake_case and past tense, and keep properties as short enums rather than free text. When you next ask an agent to add tracking, point it at this file and tell it to reuse an existing name or add exactly one.
// src/analytics.js
// Every event this app can send lives here.
// Naming rule: snake_case, past tense, object first. Properties are short enums.
const track = (name, properties) => {
if (typeof window !== 'undefined' && window.op) {
window.op('track', name, properties);
}
};
export const analytics = {
signupCompleted: (method) => track('signup_completed', { method }), // 'email' | 'google'
projectCreated: (source) => track('project_created', { source }), // 'onboarding' | 'dashboard'
generationRequested: (model) => track('generation_requested', { model }),
generationFailed: (reason) => track('generation_failed', { reason }), // 'timeout' | 'quota' | 'invalid_input'
exportDownloaded: (format) => track('export_downloaded', { format }), // 'csv' | 'pdf'
planUpgraded: (plan) => track('plan_upgraded', { plan }),
};
// src/components/SignupForm.jsx
import { analytics } from '../analytics';
const onSuccess = () => {
analytics.signupCompleted('google');
};
3
Keep personal data out of properties
The second common accident: a generator wires up tracking by passing whatever object is in scope, and the user's email, name or raw prompt text ends up as an event property. Analytics properties are the wrong place for that. Describe the event, not the person. If you genuinely need cross-session profiles, use identify() with your own opaque user id and your own lawful basis, rather than smuggling identifiers into every event.
// Wrong. Personal data in analytics properties, usually by accident.
window.op('track', 'signup_completed', {
email: user.email, // no
name: user.fullName, // no
prompt: input.value, // no, free text is full of personal data
});
// Right. Describe the event, not the person.
window.op('track', 'signup_completed', {
method: 'google',
plan: 'free',
prompt_length: input.value.length,
});
// App-wide context belongs in global properties, set once after init.
window.op('setGlobalProperties', {
app_version: '2026.07.19',
environment: 'production',
});