DOCS

Traffic analytics

Traffic stats can be enabled in WP Admin ➝ Voxel ➝ Settings ➝ Statistics

Here, you can pick the post types you want to track, decide how long you want to keep the data in your database and how often should the data update.

The last option is “IP geolocation services”.

What is IP Geolocation?

For any given visitor on the site, we need to extract their country or location so we can later build a dashboard showcasing those details.

Some host providers provide country data in their headers, in which case you won’t need any external API to extract it.

As an optional additional method, Voxel provides the option to utilize 3rd party geolocation services. The three supported ones are:

  • geojs.io
  • ipapi.co
  • ip-API.io

All these services are either free or have free limited usage and you don’t have to sign up or add an API key to utilize them.

If limits are reached in one service, Voxel will move on to the next service or method and try again.

Geolocation will be done client side, so it will not cause any strain on your server.

Is adding a service necessary?

No, if your host provider returns the country data, then setting up an additional 3rd party service is not required. Cloudflare also does the job.

Dynamic tags

Under each corresponding group: Post, User, Author, Site there’s a Stats area which includes all the dynamic tags for that group, which you can select. That data will be then displayed on that widget.

If you’re new to Voxel, get started by checking the dynamic tags documentation

The available tags are:

  • Views (Last 24 hours, Last 7 days, Last 30 days, All time)
  • Unique views (Last 24 hours, Last 7 days, Last 30 days, All time)
  • Top countries
  • Top referrers (domains)
  • Top referrers (URLs)
  • Top browsers
  • Top platforms
  • Devices
  • Last updated (Outputs the last time stats were updated)

These dynamic tags can be used anywhere on the site, but let’s take some examples how we use them.

User stats

Under User ➝ Stats there are dynamic tags for accumulated stats for posts that belong to the current user.

In the City demo, we created a dashboard page named “Analytics” and through this page, the logged in user can view stats related to their account and posts.

Here’s an example: In this video we use dynamic tags to display views that posts authored by the current user have received in the last 30 days

Post stats

Under Post ➝ Stats, there are dynamic tags that output stats related to that current post. You can use these dynamic tags on any post type template to show stats such as views on that current post.

In addition to this, we created a new template in WP Admin ➝ Theme builder ➝ Other ➝ Post statistics

This is a unified template that is used for all post types, and it’s related to the View stats action.

For example, in this listing we added the View stats action, and upon clicking, the user is sent to this template and shows statistics related to that post

then the template is utilized to show statistics for that post

Author stats

Accumulated stats for posts that belong to the author of the current post. These could be used for example to show stats for all posts by that author within a specific post or user profile. This is not utilized in the City demo.

Site stats

Stats covering all posts on the site regardless of author. Generally, these should be accessible only by administrators. Could be a regular page with condition Show if ➝ User role is ➝ Administrator. This is not utilized in the City demo.

It’s important to understand all these different stats are optional and it really depends on your project which ones you utilize. Maybe you just want to show views on single post page and leave it at that, you have that option.

Visits chart (VX)

Visits chart (VX) displays a bar chart of Views, Unique Views for stats related to Current User, Current post and Sitewide.

Continue reading