Google has been smashing websites, specially independent publishers and it seems like nobody really knows what to do to bring back those sites to life.
If we were sort of doing GuesSeo before, we are doing more of that now.
One of the thing that I have done these past few months is updating or deleting old content, which is not driving much traffic or not traffic at all.
I made that decision based on Google Search Console data.
But that’s just part of the data which I should consider since Google Search Console doesn’t take into account traffic from sources other than Google.
You might end up deleting a post which is ranking well on Bing and not ranking high on Google
That’s why we have to install Google Analytics but I hate it and I see some other people hate it as well.
So I started searching for an alternative but those alternatives aren’t free if you want to sign up and paste a script on your website.
- Matomo Analytics is $22 per month for 100 K Hits
- Plausible Analytics is $9 per month for 10 K Hits
- Umami Analytics is $20 per month for 1 million hits
That feels worse than paying for hosting. I used to pay $11.50 on Cloudways or $6 on Digital Ocean
The good thing is that you can self host and not worry about hits per month and limits.
But you gotta set everything up on a server and that ain’t easy sometimes.
I decided to give Umami Analytics because they offer a 14-day trial and no credit is required.
You should probably consider taking their trial offer and make sure if Umami is right for you.
After the trial period, you can choose to use their managed service, create as many tracking codes as you need and forget about all the the technical aspects of self-hosting this application.
I read on Reddit that Umami is lighter than Matomo and Plausible, so self hosting this analytics software might be a better idea than using Matomo or Plausible.
These are my thoughts of self-hosting Umami and start using them as an alternative to Google Analytics
Table of Contents
What I Want from an Alternative to Google Analytics
First I need a simple dashboard to get what I want as fast as possible.
I care about:
- Number of page views
- Content getting those page views
- Referrers
- Geographic Distribution
- Type of Devices
That’s pretty much all the stats I need and Umami Analytics is perfect for that.
Is Umami Lightweight?
When you have to install a third-party script, you are usually told to add it to the header of your website.
You can add them to your footer if you want to and that won’t make much difference in the way the script works.
I added the Umami Script to the footer using a mu-plugin.
Umami adds three small requests:
- The Script itself
- Two API Requests that send back the information to your dashboard so it can be processed.
Since this is a script, you can delay its execution by using plugins such as Perfmatters, WP Rocket, Flying Scripts, etc.
In case you don’t want to do that, you can these scripts or mu-plugins taken from Flying Scripts and PerfMatters.
Delaying a script means that the script will load until there is user interaction with the page.
Self-Hosting Umami on Railway App
I found a tutorial on YouTube about how to host Umami on Railway and I didn’t find the process complicated at all.
Probably cause Railway App makes it easy.
If you have never used the terminal to sync a local folder with GitHub, you might get scared a bit Git is easy if you need to do the basics.
Hosna explains it really well. Check it out
Alternatives to Analytics Software
Let’s say that you don’t really like the new version of Google Analytics and you don’t want to figure out how to install open-source software like Umami or any other Google Analytics alternative.
You still could take the Umami 14-day trial and identify what the main sources of traffic for your site/sites are.
If you find that most of your traffic comes from Google, you probably don’t need to worry about anything else and Google Search Console is more than enough.
If you find an alternative search engine like Bing is giving some love, you can check Microsoft Bing Webmaster Tools
There was a time when I didn’t even consider Bing but after Google started smashing every small site out there, I had to pay attention to what Bing is doing.
I used Umami Analytics for a day and I found out that 53% of my traffic comes from Google , 29% comes from Bing and 18% from other sources
So if you think that Google and Bing provide enough data to make a decision, you can make a decision based on the data obtained from both services and forget about third party tools like Umami.
If you are driving traffic from social media, you can get an idea of how well a piece of content performs using an URL shortener like Bitly but that would not take into account when a piece of content is shared by others.
Do you Need a Plugin to Install Umami Analytics?
Most WordPress users tend to install a plugin for tiny little they want to change or add to their sites.
You can use any plugin that outputs code to the header or footer.
Alternatively you can use a code snippets plugin such as Code Snippets
This is the one that you should use to add a script to the header:
function add_analytics_script_to_header() {
?>
<!-- Replace with your analytics script URL -->
<script async src="https://your-analytics-url.com/script.js"></script>
<?php
}
add_action('wp_head', 'add_analytics_script_to_header');
This is the one that you should use to add a script to the header:
function add_analytics_script_to_footer() {
?>
<!-- Replace with your analytics script URL -->
<script async src="https://your-analytics-url.com/script.js"></script>
<?php
}
add_action('wp_footer', 'add_analytics_script_to_footer');
WordPress provides wp_enqueue_script as a cleaner and safer way to load scripts. This ensures compatibility with other scripts and avoids duplicate inclusions.
You can also try this to add your script to the header:
function enqueue_analytics_script_in_header() {
wp_enqueue_script(
'analytics-script', // Unique handle for the script
'https://your-analytics-url.com/script.js', // URL to the script
array(), // Dependencies (none in this case)
null, // Version (use `null` to avoid appending a version query string)
false // Load in the header (true would load it in the footer)
);
}
add_action('wp_enqueue_scripts', 'enqueue_analytics_script_in_header');
or this to add the script to the footer
function enqueue_analytics_script_in_footer() {
wp_enqueue_script(
'analytics-script', // Unique handle for the script
'https://your-analytics-url.com/script.js', // URL to the script
array(), // Dependencies (none in this case)
null, // Version
true // Load in the footer
);
}
add_action('wp_enqueue_scripts', 'enqueue_analytics_script_in_footer');
You can turn any of those codes into a mu-plugin instead of using a plugin to do so.
If you want to have a plugin to install Umami Analytics on your site, you can try the following plugin: