Skip to content
Logo

Script tag

The fastest way to track a website. Paste this before </head> on every page:

<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:"call"===r||"apply"===r||"bind"===r?t[r]:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();
  window.op('init', {
    clientId: 'YOUR_CLIENT_ID',
    trackScreenViews: true,
    trackOutgoingLinks: true,
    trackAttributes: true,
  });
</script>
<script src="https://flarepanel.dev/op1.js" defer async></script>

The first script queues calls until op1.js loads, so you can call window.op(...) right away.

Calls

window.op('track', 'button_clicked', { location: 'hero' });
window.op('identify', { profileId: 'user_123', email: 'ana@example.com' });
window.op('increment', { profileId: 'user_123', property: 'logins' });
window.op('setGlobalProperties', { app_version: '2.4.0' });
window.op('revenue', 49.0, { currency: 'USD' });

Track clicks without code

With trackAttributes: true, any button or link with a data-track attribute sends an event when clicked. Other data-* attributes become properties:

<button data-track="upgrade_clicked" data-plan="team">Upgrade</button>

All options are listed in SDK options.