See your website's buyers per channel
Two lines in the head of every page count each visit, and one more on the confirmation page records the paid order with its revenue.
Package @mirafive/tracker
Set up in 4 steps
Paste the two lines into the head
Take the website key (
mf_…) of your website source from Data → Sources, put it indata-keyand paste both lines into the<head>of every page, usually the theme header or shared layout. The key is public and safe in page source.Code for step 1 of the any website setup: Paste the two lines into the head. <script>window.mirafive=window.mirafive||function(){(mirafive.q=mirafive.q||[]).push(arguments)}</script> <script defer src="https://cdn.mirafive.io/mira.js" data-key="mf_…"></script>
Pass your banner's answer
For a Full source only. Add
data-mode="full"to the tag, and nothing is sent or stored until the visitor answers. Wire your banner to theconsentverb:truegrants statistics only,falseforgets the ids and the user, and{ statistics, experiments, targeting }answers each scope. The docs show a Cookiebot example.Code for step 2 of the any website setup: Pass your banner's answer. <script>window.mirafive=window.mirafive||function(){(mirafive.q=mirafive.q||[]).push(arguments)}</script> <script defer src="https://cdn.mirafive.io/mira.js" data-key="mf_…" data-mode="full"></script> <script> // Call from your banner whenever the visitor answers or changes their choice. mirafive('consent', { statistics: agreedToStatistics, experiments: agreedToPreferences, targeting: agreedToMarketing }) </script>
Send the paid order
On the page that confirms the payment, one more line records the order with its revenue and currency. It works with the script tag alone, and in full mode with consent it lands on the person who bought.
Code for step 3 of the any website setup: Send the paid order. <script> mirafive('track', 'order_paid', { revenue: 328, currency: 'EUR' }) </script>
Check the live view
Open the site on its real domain; localhost sends nothing unless you add
data-track-localhost. Runmirafive('flush')in the console, look for the batch toevents.mirafive.ioanswering202, and find your visit under Data → Live.
MIRA FIVE is analytics built around the person. The hosted script, @mirafive/tracker, is for any site where you
can edit the head: a CMS, a site builder, a shop theme or static HTML. It is about 4 kB, needs no build step, and
records a pageview for the landing page and every client-side navigation.
Where do the two lines go?
Into the <head> of every page, wherever your system keeps it: the theme header, the shared layout or the base
template. There is no plugin for Shopify, Shopware, WooCommerce or WordPress, so the lines go into the theme like
any other script. Load mira.js by src; it does not work inlined. On Laravel and Symfony, the server package
prints the tag for you: see the Laravel and Symfony setups.
How does a paid order reach its channel?
Through the person who paid. In full mode, after the visitor agreed, identify signed-in customers with your own user id and forget them on sign-out:
<script>
// After login
mirafive('identify', 'user_123', { plan: 'pro' })
// After logout
mirafive('reset')
</script>The order_paid from the confirmation page then lands on that person, next to the channel of their first visit.
Ids live in localStorage, never in cookies. Create a purchase goal for order_paid, and Acquisition shows buyers
and revenue per channel and campaign.
What else can the tag do?
data-autocapturerecords clicks, form submits and field changes without code, never what a visitor typed.data-hostsends events through a proxy on your own domain.- The same files are on npm as
@mirafive/tracker, if you would rather host the script yourself.
The source’s Install tab has Let your coding agent install it, a prompt for Claude Code, Cursor or Codex with the key, every step and the check. The script tag docs list every attribute, and the setup page shows who does what, in order.
Other setups
The same numbers, whichever way your site is built.
Questions and answers
Is there a plugin for Shopify, Shopware, WooCommerce or WordPress?
What does the default setup collect?
Does it count pages in a single-page app?
/#/pricing, add data-hash; for full control, add data-manual and call mirafive('pageview') yourself.What does my Content Security Policy need?
script-src https://cdn.mirafive.io and connect-src https://events.mirafive.io. The inline queue line needs the page's nonce or its hash in script-src.