NeoAnalytics 👩‍🎤
ConceptPageView scriptEvent enhancementInsightsHomeKonfigurationTradeoffs

NeoAnalytics Concept

NeoAnalytics is a privacy respecting service providing a seemless experience to website visitors without annoying cookie banners, while still providing website operators with insights to optimize their web presence.

To achieve this we build an analytics solution with privacy as the number one concern. Never storing any personal information on our systems and never storing anything in the clients browser, neither cookies nor information in other storage solution.

PageView script

To integrate NeoAnalytics into your website all you need to do is add the below script.

<script async defer src="https://app.neoanalytics.de/neoClient.js"></script>

Now our script will make sure to send a request to our servers for each visit to your page and each navigation on Single Page Applications (React, Angular, Vue, etc.).

A request send contains a payload like the one below.

{
"hostname": "hendrikwallbaum.de",
"path": "/",
"width": 1280,
"referrer": ""
}
  • hostname taken from window.location.hostname - the page this page view is recorded for.
  • path taken from window.location.pathname - the path on a page a user is currently visiting.
  • width the devices width from window.innerWidth - later used to distinguish visiting device types.
  • referrer the site you came from, stripped down to it's hostname to protect personal information.

Referrer

Referrer is gathered from one of two sources:

  • Document.referrer, this is set when navigating between pages. We strip this down to the hostname, to defend personal data.
  • Query parameters, we also look at query parameters, namely: ref and utm_source. For these we take the entire string provided. Query parameters overrule referrers.

Query Parameters overrule referrers. With ref being the most important.

Event enhancement

Server side each page view event gets enhanced with more context. The final element stored looks like such:

{
"hostname": "hendrikwallbaum.de",
"path": "/",
"width": 1280,
"referrer": "",
// From here added on server.
"id": 1,
"browser": "Chrome | Firefox | Safari",
"os": "Windows | Android | iOS | macOs | Linux",
"created_at": 1235456867,
"visitorHash": "3de3f6c2a19aef2ef012fc44a8842e3bc8d099d1c2a2bedfefc1d08a181a7c96",
"isOpeningSession": true
}
  • id a database specific id.
  • browser parsed from UserAgent sent by the browser this stores the browsers name without any additional information. We store "Chrome" and not "Chrome 83".
  • os the Operating system, also parsed from UserAgent and not more specific than name.
  • created_at timestamp to analyse events over time.
  • visitorHash a one-way-hash to identify unique users.
  • isOpeningSession whether this pageview marks the start of a new session.

visitorHash

The visitorHash is calculated by one-way-hashing the hostname, userAgent and IP of a user using SHA256.

The visitorHash is a unique identifier for a user who visits a specific site with a non-updated device over the same IP.

For the same user on the same, non-updating device it should change at least once a day, when their ISP provide them a new IP.

For users on mobile phones using their mobile network instead of WiFi you might end up with multiple devices having the same IP, which we catch by using the UserAgent here as well. This scenario might also find devices with often changing IPs, in which case we will consider them new, unique visits.

The visitorHash is different for the same user visiting multiple NeoAnalytics using sites on the same device over the same network, since we include the hostname in the hash. NeoAnalytics does not posses enough data about users to track them across sites.

In the unlikely event of either the visiting clients IP or UserAgent not being present uniqueness of a visit is inferred by comparing referrer and hostname. Should they be unequal a random string is added to the information being hashed to create a unique visitor preserve the count of unique visitors as best, as possible.

Sessions

Some pageviews are opening new Sessions. As a Sessions we see any visit of a user to our page where the referrer differs from the hostname.

For SPAs our client-side library ensures to always set the referrer equal to the hostname for pageviews of consecutive navigations on the page.

This is prone to creating a few more sessions than what could be detected using cookies and other mechanisms but we take this trade off to product visitors privacy.

Insights

This section describes a typical dashboard.

At the top we find the domain we are currently viewing insights for, as well as the accumulated count of unique visitors over the last month (based on visitorHash). The graph below shows both unique visitors and page views per day. Having both these values enables customers to gain insights no only on how many visitors they are having but also into how active these visitors are on their page. What is not shown in the early prototype below is a third graph indicating sessions opened on a given day.

Below the graph we find more detailed insights.

  • Sources (Quellen) lists all referrers over the path month together with how often someone came to your page from this source.
  • Paths (Pfade) lists the absolute amount of time that a specific path was visited. Please note that we append a trailing "/" to each path to prevent different entries for the same path. (as shown above)
  • Browser Lists the absolute number of visitors using specific browsers.
  • Devices (Geräte) lists devices used to browse a page as a percentage of the total number of unique visits. Based on the width of devices.
  • Operating Systems lists the absolute number of used operating systems.