Update: this plugin was originally called Ackee WP but has been renamed to Soapberry to comply with the WordPress.org trademark policy for plugins. The plugin can now be found on WordPress.org under the slug Soapberry.
As part of my desire to own my data, I haven’t used Google Analytics for the past few years. In that time I’ve been curious about my site statistics but knew when I resumed collecting data I wanted to do so in a way that respected the privacy of my visitors.
This year I started a search for self-hosted tracking solutions and came across a lightweight node application, Ackee. After looking at a few other options I decided on Ackee for its care in anonymizing user data. Through hashing the user’s IP, a unique domain ID, and a salt which changes daily, site visits can be tracked without tracking the individual visitors.
For my needs, I want to know how many visits my sites are getting, where visitors are coming from, and how long they stay on the site. However, I do not have a need or desire to track individual visitors.
Using Ackee with WordPress
After setting up an Ackee instance and adding the tracking script to a few static sites I wanted to bring the functionality to my WordPress sites. At first, I just edited the theme’s
footer.php file which worked well enough as a quick way to insert the script. Next, I hooked into
wp_footer() so it would be easier to exclude logged in visits from the analytics.
While both of these methods work they do require a bit of WordPress know-how and do not carry over when switching themes. Wanting a better solution, I got to work writing Soapberry a WordPress plugin that adds the Ackee tracking script and data attributes to the site’s footer based on settings saved on a WP Admin page.
Keeping things simple at first, this first version of the plugin only has the ability to exclude all logged-in visitors and does not take into account the personal data options provided by Ackee. In the future, you may be able to exclude visits by role and enable opt-in tracking for personal information.
Exploring Ackee Alternatives
If after looking at Ackee you don’t think its right for you that’s okay. Ackee won’t be right for everyone. The good news is there are other options when looking to move away from Google Analytics, Facebook Pixel, or other third-party tools.