See which visits turn into sales in your Vendure store. No cookies, no cookie pop-up, no bots.
You want to know where your buyers come from. But Google Analytics uses cookies, so in many countries you must show a cookie pop-up first (the box that asks visitors to say yes to cookies). Many people click no, so their visits and their orders never show up in your numbers. Bots add fake visits on top.
This plugin adds Privatus Analytics to your Vendure storefront. It gives your storefront the tracking script, and it gives each placed order a revenue event that your order confirmation page sends from the browser. The script sets no cookies and keeps no IP addresses. Bots are filtered out before they are counted.
So you see how many real people came, where they came from, and how much they spent, on one simple dashboard.
Free plan, no card: 10,000 events a month (an event is a page view or an action you track) on up to 3 sites. Start free at privatusanalytics.com.
Purchase event with
the amount and currency, so you can see which pages and links bring sales.privatusAnalytics query to the Shop API. It returns the site ID,
script URL, modules and a ready <script> tag for the current channel.privatusPurchaseEvent field to Order in the Shop API. Once an
order is placed, it holds the event name and its props: revenue (in major
units, so 54.99), currency (such as USD) and items (how many items).
No order code, names, emails or addresses.@privatus-analytics/vendure-plugin/browser,
that loads the script and sends the purchase event once per order.It works with Vendure 3. It adds no database tables and no Admin UI.
Add the plugin to your Vendure config:
Find your site ID on your site's setup page at
privatusanalytics.com. It starts with pa_.
No database migration is needed.
| Option | Default | What it does |
|---|---|---|
siteId | none | Your site ID, such as pa_ABC123. |
channelSiteIds | {} | A different site ID per channel, keyed by channel code, such as { 'uk-store': 'pa_UK123' }. Other channels use siteId. |
modules | ['engage', 'auto', 'vitals', 'clicks', 'ask'] | Tracker modules to turn on. |
scriptSrc | https://privatusstats.com/js/pa.js | Where the script loads from. Change it only if you serve the script from your own domain. |
purchaseEventName | Purchase | The event name for a placed order. |
revenueField | totalWithTax | Which order total is the revenue. Use total to leave tax out. |
The amount uses the precision of your money strategy, which is 2 by
default. So a totalWithTax of 5499 becomes 54.99.
Ask the Shop API for the tag:
If your storefront renders on the server, print scriptTag in <head>. It
looks like this:
If your storefront renders in the browser, use the helper:
siteId is null when no valid site ID is set for the channel. Then nothing
is loaded.
Ask for privatusPurchaseEvent where you already load the placed order:
Then send it from the browser:
This calls privatus.track('Purchase', { revenue: 54.99, currency: 'USD', items: 2 }).
It is safe to call before the script has loaded, because calls wait in a
queue. The same key is sent only once per page load. Before the order is
placed, privatusPurchaseEvent is null and nothing is sent.
You can also skip the GraphQL field and pass an order object you already have:
If you already use @privatus-analytics/next, @privatus-analytics/react
or another Privatus Analytics package, you can pass the event to its
track() function instead:
In Privatus Analytics, add a goal for the custom event Purchase and set its
value to Event revenue. Revenue is shown in your site currency. Other
currencies are changed using daily exchange rates. See
revenue tracking and
custom events.
The tracker sets no cookies and uses no device IDs. This plugin only gives your storefront the script and the order total. See the privacy documentation for what is collected.
If you have a privacy policy, it should say which tools handle your visitors' data. You can paste this:
This website uses Privatus Analytics to count visits. It does not use cookies and does not follow you from one website to another. Your IP address is used for a moment to count visits and is never stored.
Change it to fit your site.
MIT licensed. See LICENSE.
privatusAnalytics with the site ID, script URL, modules and a ready script tag for the current channel.Order.privatusPurchaseEvent with the revenue, currency and item count of a placed order.@privatus-analytics/vendure-plugin/browser with loadPrivatus(), track() and trackOrderPlaced().