# Install on Plain HTML

The snippet is first-party when you host cashline.js on the same origin as the site you measure. Replace YOUR_ORIGIN with the Zarstat deploy that serves the script, or copy public/cashline.js onto your own domain.

## Add the queue, then the script

Put this before </body> on every page you care about. data-site is the site you already use. zarstat() is an alias for cashline().

```
<script>
  window.cashline = window.cashline || function () {
    (window.cashline.q = window.cashline.q || []).push(arguments);
  };
</script>
<script src="https://YOUR_ORIGIN/cashline.js" data-site="YOUR_SITE"></script>
<script>
  cashline('pageview');
</script>
```

## Fire a purchase after the processor confirms

Amount is rand, not cents. Only call this when Paystack (or your own webhook) says the charge succeeded.

```
cashline('purchase', {
  amount: 199,
  currency: 'ZAR',
  reference: 'ORD-1042'
});
```
