Skip to main content

Command Palette

Search for a command to run...

How to Add Google Analytics to Your Hashnode Blog

A step by step guide to add the free analytics tool to your blog in just a few minutes

Updated
2 min read
How to Add Google Analytics to Your Hashnode Blog
S

Software Engineer

Background

Every blogger wants to know how their work is being received by the community. However, understanding your readers can be like staring into the void. Google Analytics is the light that you might be looking for.

Google Analytics offers a plethora of detail about your readers. The core features entail measuring the number of site visitors, sessions, and duration spent on the site. Best of all, it's totally free :).

Google offers an academy for those interested in learning more about the features.

Google Analytics logo

Tutorial

  1. To add Google Analytics to your Hashnode blog, open Google Analytics and login using a Gmail account.
  2. First you will have to go through account setup. The account name can be anything you like and you can track multiple sites with one account. Account setup on Google Analytics
  3. Next you must setup a property. A property is equivalent to a site that you want to track. Enter the title of your website in the property name field.
  4. Recently Google has migrated to a newer version, Google Analytics 4 (GA4), that is not supported by Hashnode. Hashnode supports the older Universal Analytics (UA). The differences are complex, but core functionality is the same. To create a Universal Analytics property click on show advanced options (highlighted with an arrow below). Setup your website property in Analytics
  5. Provide the URL of your blog. Since Hashnode only supports UA, we will only create a UA property. A GA4 property can be created later if necessary. Creating an UA
  6. Provide some basic information about your site and what you will be using Google Analytics for. About your business section on Analytics
  7. After clicking create a Universal ID will be generated. It will be a number starting with UA. Copy this number and open your blog's dashboard on Hashnode. UA ID created after clicking create
  8. Click on the integrations tab. Enter the Universal Analytics ID provided by Google Analytics. After entering the Universal Analytics ID click update at the bottom of the page. Hashnode field to enter Analytics ID
  9. Now you can open Google Analytics and you will begin to see blog traffic data appearing as users visit your site.

Screenshot of Google Analytics data

That's it! Sit back and enjoy all the glorious new data.

D

Thank you, Sean. This article was a great help. Hashnode has now started supporting the GA4 tracking ID. I'm using GA4 instead of UA.

C
Cess3y ago

Thanks for sharing

A

Google is going to stop recording data using Universal Analytics soon. Any other way to do this?

image.png

S

Good point. This isn't something I've tested but maybe you could place the script in this field under the integrations tab? Not sure if that would work because it does say meta tags.

image.png

E

Good stuff! Thanks for the writeup. I found Googling for this possible, but confusing-just like you said! :)

O

Hey Sean! Thanks for this post! This is really what I was looking for! Should be "Must Read" for new Hashnode bloggers :)

U

Great article. It's help me a lot in setting up my blog.

1
How to Add Google Analytics to Your Hashnode Blog