Open source alternatives to Google Analytics on your hosting



The web interface of the open source analytics service Matomo



Deglogging of online life requires the introduction of free alternatives in all areas. Privacy advocates maintain a list of such products by category.



From the point of view of the system administrator, these lists have a separate category of web analytics - a replacement for the Google Analytics service, which collects detailed statistics about site visitors. Everyone knows how such a service works. Implement the tracking JS code on the pages, and if the person has not installed the tracking script blocker, then this script will be triggered every time the page is opened. Further, statistics on your users are sent to Google for storage .



Fortunately, there are a number of free, open source Google Analytics alternatives that are faster because the scripts are smaller and are downloaded from your own hosting rather than a third party server. Information about users is not sent anywhere, and many services do not use cookies and comply with the GDPR legislation on the protection of personal data.



Let's start with the freshest. The Umami tool launched a few weeks ago in August 2020.



Umami



It is an open source program released by Adobe developer Mike Cao. He was looking for a simpler and faster Google Analytics alternative for his websites - and ended up just developing his own solution.



Installation on the server:



git clone https://github.com/mikecao/umami.git
cd umami
npm install


Umami provides statistics on views of all / specific pages, by browser, OS, referrer, device and country. Shows the number of visitors and views, bounce rate and average visit time per day, week, month. Many do not need more.



The Umami script works almost instantly, and full statistics are displayed on one page. Example of such a page: One of the advantages of your hosting is the ability to bypass some ad blocker rules that prohibit downloading scripts from third-party sites. In addition, the loading of the web page is greatly accelerated: the Umami script is very small (only 6KB). Embed: In addition to basic functionality, Umami is configured to track arbitrary events















, for example, pressing a certain button. Let's say we have a button like this:



<button class="button">Sign up</button>


create a new class:



umami--<event>--<event-name>


and write this class for the button:



<button class="button umami--click--signup-button">Sign up</button>


Statistics for three buttons on the site:







All data recorded by the tool is anonymized and stored in a MySQL or PostgreSQL database. You need Node.js 10.13+ to work.



The source code is published under the free MIT license and can be viewed in the repository on GitHub .



If you want to see the tool in action, the developer has organized a live demonstration of Umami online . In the official documentation , see. Installation instructions and an overview of functions.



Matomo (Piwik)



If for some reason you are not satisfied with Umami, you can try other open source systems. One of the most famous is Matomo (formerly Piwik). Matomo has much richer functionality than Umami. For example, there is data import from Google Analytics, reports on the speed of generation of individual pages , notifications by mail / SMS in case of the specified events, content tracking , a separate analytics module for online stores, and much more. The interface of the panel with statistics is more flexible with the help of widgets. Widgets for customizing the main screen of Matomo In addition to the version on its own hosting, a paid version of Matomo Cloud is offered.





















Matomo explicitly positions itself as a safe alternative to Google Analytics, and the company periodically publishes news on its blog about legal claims against Google in connection with sending user data to the United States, which potentially violates the GDPR.



Even the free version has more functionality than Umami, and the paid Premium Bundle offers additional functionality, including heatmaps, session recordings, custom reports, A / B testing, conversion tunnels, keyword SEO statistics, log auditing, and more. e. Comparison of free version, paid features and cloud version can be found here .



Plausible Analytics



Another open source tool. The program code is publicly available , nothing prevents you from taking it and installing it on your server, although the company is actively promoting the "cloud" version costing from $ 6 per month (this is the minimum price for sites with traffic less than 10 thousand visitors per month). Unlike Matomo, the open source Plausible version is no different from the paid cloud version in terms of features. Plausible also positions itself as a free and secure alternative to Google Analytics that does not use cookies and is fully GDPR compliant.















Limited functionality can be seen as an advantage. Indeed, a very small number of site owners need most of the Google Analytics features, but we have to pay for them with the privacy of our users, legal risks and slower sites. Google Analytics scripts are loaded from third party servers adding delay to page load. In addition, they are large in themselves (two scripts totaling 45.7 KB) and take time to execute on the client side. For comparison, here are the sizes of Google Analytics scripts and open source platforms from this roundup:



Tool Script The size
Google Tag Manager googletagmanager.com/gtag/js 28 KB
Google Analytics google-analytics.com/analytics.js 17.7 KB
Umami umami.js 6 KB
Matomo matomo.js 22.8 KB
Plausible Analytics plausible.io/js/plausible.js <1 KB


The sheer size of Google Analytics scripts is explained by the fact that the tool tracks hundreds of metrics for more than 125 different reports.



Plausible Analytics is the most ascetic option. This is a tool for those who need minimal statistics. It's even a little strange that with such modest functionality the company offers advanced corporate plans for $ 150 per month.



Plausible demo page .



Other open source tools



Other open source tools with similar functionality:





Instead of counters, log analyzers like GoAccess are suitable , which work in real time and generate equally informative diagrams: GoAccess Demo GoAccess is also an open source program. Repository . Demo .
















Of course, these tools cannot be called a full-fledged replacement for the Google Analytics system, which operates in the proprietary Acquisition / Behavior / Conversion paradigm . But self-hosted open source scripts are a really good alternative in many cases.



PS According to W3Tech statistics for September 2020, Google Analytics scripts are installed on 55.3% of sites on the Internet. The most popular open source analytics tool has only 1%.



2019

01.09
2019

01.10
2019

01.11
2019

01.12
2020

01.01
2020

01.02
2020

01.03
2020

01.04
2020

01.05
2020

01.06
2020

01.07
2020

01.08
2020

01.09
No 34.1% 34.5% 34.9% 34.9% 34.9% 35.1% 35.2% 36.1% 36.2% 35.1% 34.7% 34.7% 34.3%
Google Analytics 56.3% 55.9% 55.5% 55.5% 55.4% 55.1% 55.0% 53.8% 53.6% 54.6% 55.0% 55.0% 55.3%
Facebook Pixel 8.5% 8.5% 8.5% 8.7% 8.9% 8.9% 9.1% 9.0% 9.0% 9.3% 9.4% 9.5% 9.7%
Yandex.Metrica 5.8% 5.8% 5.9% 6.1% 6.5% 6.7% 6.9% 7.0% 7.2% 7.3% 7.4% 7.4% 7.4%
WordPress Jetpack 4.8% 4.7% 4.7% 4.7% 4.6% 4.6% 4.6% 4.6% 4.6% 4.7% 4.8% 4.8% 4.8%
Hotjar 2.7% 2.7% 2.7% 2.7% 2.8% 2.8% 2.8% 2.8% 2.8% 2.9% 2.9% 2.9% 2.9%
LiveInternet 2.3% 2.2% 2.2% 2.3% 2.4% 2.5% 2.5% 2.5% 2.5% 2.6% 2.6% 2.5% 2.5%
New relic 1.5% 1.4% 1.4% 1.4% 1.4% 1.4% 1.5% 1.5% 1.4% 1.4% 1.3% 1.3% 1.3%
Matomo 1.1% 1.1% 1.1% 1.1% 1.1% 1.1% 1.0% 1.0% 0.9% 1.0% 1.0% 1.0% 1.0%
Top.Mail.Ru 0.8% 0.8% 0.8% 0.9% 0.9% 0.9% 0.9% 0.9% 1.0% 1.0% 1.0% 1.0% 1.0%


The share of Google Analytics seems to have begun to decline in early 2020, but now it is growing again.






Advertising



Reliable and inexpensive VDS from VDSina will allow you to place any project - everything will work smoothly and with high uptime!






All Articles