This blog post is going to explain how to display your tracked WordPress page views using Grafana, and the best bit there is no cost 😊
We are going to explain some terminology to start off with….
Example if person x visited your site then visited again it would be 2 visits however 1 visitor
Visits – The number of times someone has loaded a page on the site non unique
Visitor – The amount of times someone unique has visited your site
Before you start!
You will need to make sure you have a Grafana instance hosted somewhere with access to your mysql db to pull the required information. There are 100’s of guides online on how to setup Grafana yourself or even use Grafana’s SAaS solution if this is easier for you.
You will also need to know the username and password for you WordPress admin account if this is not you.
As the guide requires reading the SQL DB you will also need to know the password to inspect all the tables within the database.
Step 1
Step 1 is a simple one, make sure you are logged as an admin to the WP-admin panel, once in please install the plugin WP Statistics, if it is not there or you having trouble installing google is your friend for this one, as there are a number of guides online for this.
Once installed you will need to make sure that the plugin is activated so you start collecting stats otherwise this is not going to work.
Step 2
If you login to your PHP myadmin you will now see a list of new entries in the list with statistics will be called wp_statistics
What we are interested in is visit visitor and online
Step 3
Setup Grafana datastore
- Go to add new connection
- Select My SQL
- Put in the data about where your DB is and the DB Name
- Authentication method
- Save and test
Example below
Step 4
Add the dashboard to Grafana
New Dashboard >Import
Then paste the JSON below
There is a good chance you will see the triangle of error like below
You will need to make sure that each panel has a reference to your database so mine has “wp_” however yours might not.
No responses yet