-
Make an
index.html
file with the below code and deploy it using GitHub pages<html> <head> <title> Analytics Test </title> </head> <body> Hello! </body> </html>
-
Go to google analytics dashboard, click on create a new property
-
Choose “Web” as the platform
-
Setup the web stream by entering your site’s url
-
Click on view tag instructions and add Google’s script tag to your
index.html
<html> <head> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=<G_TAG>"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '<G-TAG>'); </script> <title> Analytics Test </title> </head> <body> Hello! </body> </html>