Skip to content
Privatus-AnalyticsPublic

About

Privatus Analytics plugin for Bubble: cookieless website analytics, no cookie pop-up, bots filtered out

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Privatus Analytics for Bubble

Real visitor numbers for your Bubble app. No cookies, no cookie pop-up, no bots.

You want to know who visits your Bubble app. 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 they never show up in your numbers. Bots add fake visits on top.

This plugin adds Privatus Analytics to your app. Drop one element on your page and paste your site ID. That's it. 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, which pages they looked at and where they came from, on one simple dashboard. You can also count your own actions, like "Signup" or "Upgrade", from any workflow.

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.

  • No cookies. No cookies and no hidden IDs on your visitors' devices, and no IP addresses are kept. Laws differ by country, so check your own legal advice.
  • Real people, not bots. Known bots, data centers and spam visits are left out on every plan.
  • Small and fast. The script is about 3 KB when compressed.

How to use it

  1. Sign up free at privatusanalytics.com and add your site. Copy your site ID. It looks like pa_ABC123.
  2. In Bubble, open Plugins, click Add plugins, search for Privatus Analytics and click Install.
  3. Drag the Privatus Analytics element onto your page. It shows nothing to visitors. Put it in a reusable header if you use one, so every page has it.
  4. Paste your site ID in the element's Site ID field.
  5. Deploy your app. Visits show up on your dashboard within a minute.

Only the live and test versions of your app send visits. The Bubble editor does not.

Count your own actions

In any workflow, add the action Privatus Analytics - Track event. Give it a name like Signup. You can also add up to five key and value pairs, like plan = Pro. They show up under Events on your dashboard.

Element fields

Field What it does
Site ID Your site ID from Privatus Analytics. Must look like pa_ABC123.
Modules Extra features, split by commas. Leave it blank for the default: engage,auto,vitals,clicks,ask.

Element states

State Type Meaning
loaded yes / no The tracker was added to the page.
error text Why it was not added, for example a site ID that is not valid.

Where your data goes

The element adds this tag to the page:

<script defer src="https://privatusstats.com/js/pa.js" data-site="pa_YOURSITEID" data-modules="engage,auto,vitals,clicks,ask"></script>

The script loads from privatusstats.com each time a page opens, so it can get fixes without a new plugin version. Events only ever come from that script in the visitor's browser. Nothing is sent from a server. Read more in the docs.

About this repo

Bubble plugins are made in Bubble's own plugin editor, not from files. This repo holds the code for each box in the editor, with tests. npm run build writes the exact text to paste into dist/:

File Where it goes in the plugin editor
dist/shared-header.html Shared tab, HTML Header
dist/element-initialize.js Element Privatus Analytics, function initialize
dist/element-update.js Element Privatus Analytics, function update
dist/action-track-event.js Action Privatus Analytics - Track event (client side), function action

The shared header holds no user data. It sets up window.PrivatusBubble and the official window.privatus queue, so a Track event that runs before the script loads is kept, not lost. The element checks the site ID against ^pa_[A-Za-z0-9]+$ and the modules against letters and commas before it adds the tag, and it only ever adds one tag per page.

Plugin editor setup

Element "Privatus Analytics": Category Analytics, default size 20 x 20, Fields site_id (Caption "Site ID", Editor Static text, Type text) and modules (Caption "Modules", Editor Static text, Type text, optional, default blank). Exposed states loaded (yes / no) and error (text).

Action "Privatus Analytics - Track event": Action type Client side, Category Analytics. Fields event_name (Caption "Event name", Dynamic value, text), then key1 / value1 up to key5 / value5 (Caption "Key 1" and "Value 1" and so on, Dynamic value, text, optional).

Develop

npm install   # .npmrc sets legacy-peer-deps
npm test      # builds dist/, then runs the dist files in jsdom the way Bubble calls them

License

MIT, Two Phase LLC. See LICENSE.

About

Privatus Analytics plugin for Bubble: cookieless website analytics, no cookie pop-up, bots filtered out

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages