Getting Google Analytics on readthedocs

If you’re like me, you like the following things:

  1. Knowing about people who use your software
  2. Not hosting your own documentation

As a result, you want some sort of analytics on readthedocs!

If you’re very like me this will have resulted in you spending a fruitless morning looking through the results of google and finding none of the solutions work at all.

Well, allow me to fast forward this process for you. The correct way to add google analytics to your readthedocs instance is as follows:

  1. Go to the Admin page for your project
  2. Click on “Advanced settings”
  3. Enter your Google Analytics Tracking ID in the box at the bottom that says “Analytics ID”

That’s it.

I have literally no idea how you are supposed to discover this. I found it by accident while messing around with build settings to try to get one of the other solutions to build. Hopefully this is of use to you.

This entry was posted in Uncategorized on by .

2 thoughts on “Getting Google Analytics on readthedocs

  1. Matt Stibbs

    Hi David,

    I had exactly the same issue and eventually your blog post confirmed that all I need to do is put the analytics code into the Advanced Settings – however several hours later I’m still not seeing any results in Google. I was just wondering whether you found there was a delay in data coming through, or whether there was anything else you had to set up in your repository / google analytics account to ensure it was tracking?

    Thanks, Matt

    1. david Post author

      I’m pretty sure that was all I needed to do. Stats should start appearing in Google analytics immediately.

      Have you checked the html of your docs to see if your code is there? If it’s not, maybe try forcing a rebuild?

Comments are closed.