Adding Google Analytics to a Static Website

A CMS software like WordPress is awesome because it lets you get statistics in real-time, like page visits, link hits, and many more; in my case, I was unsure what I need to do with a static website and add analytics to it. So I decided to look for ideas quickly.

I use Google Analytics in other business websites that I have set up, but those run on Squarespace or WordPress, in this case, my website is hosted in S3, so I was curious

Adding Google analytics to a static website hosted in S3

My friend google has all the answers, so I went to my Google Analytics Account

Going to the Admin Section of Google Analytics

UntitledImage

Select the account that you want to host all the Google Analytic properties –> Click where it says Create Property

UntitledImage

We are going to add my Resume page, which is also hosted using S3

UntitledImage

Select the options that are more appropriate to your situation

UntitledImage

Next we are going to land under the Data Streams section – In my case I would like to use Web as my platform

UntitledImage

Once I do that I would like to make sure I have all the options selected under the Enahanced Measurement

UntitledImage

Last but not least, I have to make sure I tell google about my website

UntitledImage

After entering the information, and clicking create Stream, I land in the following page

UntitledImage

This is basically giving me all the code that I need to add to my “property” in this case my static website – I need to open up my index.html file and add that code to it

You really need to make sure you add the script section right after the Head section. After loading the script to my index.html is time to test it out

UntitledImage

If everything worked fine we should see some data in Google Analytics by using the Real time Report – Let’s see
UntitledImage

Good enough I see some activity right away, there was no waiting time to get info

Creating something like this?

If you are interested in doing a quick Links Project, make sure you follow my previous Post Series on Creating a Links Website – S3, CloudFront & Certificate Manager – Supporting SSL + HTML/CSS – I’m a noob to all this but I enjoy learning a bit more of information every time I have the chance.

Feel free to take a look at my previous 2 projects:

Resume Static Page (Using S3, CloudFront and ACM)

Links Static Page (Using S3, CloudFront and ACM)

What is next?

I need to figure out what will be next for me on this series of projects, I feel like everything is going more into web development, and I really feel that is not the course I would like to take, but seriously this has been a very nice experience.

About the Author:

Andres Sarmiento, CCIE # 53520 (Collaboration)
Started working professionally in 2003, Andres is specialized in Unified Communications and Collaboration technologies | Enterprise Networks and Network Security. Consulted for several companies in South Florida, also Financial Institutions on behalf of Cisco Systems. Andres has been involved in high-profile implementations, including Cisco technologies, such as Data Center, UC & Collaboration, Contact Center Express, Routing & Switching, Security and Hosted IPT Service provider infrastructures.

You can follow Andres using Twitter, LinkedIn, or Facebook.

Leave a Comment

Your email address will not be published.

Scroll to Top