DEV Community

Cover image for Ackee, an alternative to Google Analytics?
Daniel Cano
Daniel Cano

Posted on

Ackee, an alternative to Google Analytics?

Hi DEV community, it's gonna be my first post so, let's do it!

I was looking for a tool for analytics on my personal page, but I didn't want use Google Analytics, you know, for all the privacy and other issues with users.

Ackee

After researching on the internet I found Ackee, and how they describe themselves:

Self-hosted, Node.js based analytics tool for those who care about privacy. Ackee runs on your own server, analyses the traffic of your websites and provides useful statistics in a minimal interface.

Self-Hosted

In my case, to make it work I decided to deploy it in Heroku, so I created an app instance and uploaded the code to it. Ackee needs a MongoDB to work, so there are two options:

  • Use one of Heroku add-ons for MongoDB
  • Use MongoDB Atlas and connect with the app

I used the second one, so if it's your case you have to put some Config Vars in Heroku like ACKEE_PASSWORD, ACKEE_USERNAME, MONGODB_URI and the last but not the least important ACKEE_ALLOW_ORIGIN to enable CORS. Without this last one pointing to your site you will have troubles with CORS.

Implement With Gatsby

My page is made with Gatsby so that it could work together with Ackee I needed to do one last thing, put the plugin to connect them.
It can be done with npm or yarn:

  • npm install --save gatsby-plugin-ackee-tracker
  • yarn add gatsby-plugin-ackee-tracker

Finally, all we have to do is config the plugin in gatsby-config.js, we can do it like this:

plugins: [
  {
    resolve: "gatsby-plugin-ackee-tracker",
    options: {
      // Domatin ID found when adding a domain in the admin panel.
      domainId: 'YOUR_ACKEE_DOMAIN_ID',
      // URL to Server eg: "https://analytics.test.com".
      server: 'https://analytics.test.com',
      // Disabled analytic tracking when running localy
      ignoreLocalhost: true,
      // If enabled it will collect info on OS, BrowserInfo, Device  & ScreenSize
      detailed: false
    },
  },
]
Enter fullscreen mode Exit fullscreen mode

Conclusion

I think I end up lengthening a bit with the explanation ... But I would like to know, what do you think? Do you think it is a good alternative? Do you know other better ones?

I know that it isn't so complete like Analytics or other tools but for little sites or personal pages and especially for all those who care about the privacy of their users it's a good alternative.

I will be happy to read you!

P.S

If you have come this far, thanks for reading the article and have a nice day!! 🤙🏽

Top comments (5)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

IMO, it depends on the analytics dashboard (visuals), as well as insights.

Bring your own database is also interesting in that you may crunch the data, and build a dashboard yourself; but also depends on what data is actually being collected.

Also, of FOSS projects, what I do nowadays is, if there is a Sponsor or Support button, push it (and pay).

Collapse
 
danimexivasco profile image
Daniel Cano

Completely agree! Nobody lives of air and when the project helps you and it's worth it, I think it is necessary to support it.
At least sharing it so that as many people as possible know it, and in the ideal case, supporting them monetarily.

Thanks for your contribution Pacharapol!

Collapse
 
growthfyi profile image
Ankit

I was about to write a detailed guide.😑

Collapse
 
danimexivasco profile image
Daniel Cano

Go ahead then! 😁 I have not gone into much detail, surely if you do it will help someone! 👌🏽

Collapse
 
growthfyi profile image
Ankit

I'll post it soon.