- Google Analytics

Google Analytics

A quick note before before we begin

Google Analytics is currently in the process of introducing a new way to activate and integrate its code snippet to a select group of users. This means that your account may not necessarily qualify for the new approach and that you may encounter a different onboarding experience. To mitigate confusion, Google recently released a step-by-step guide introducing its integration process, and I recommend that you review this guide at

Enabling Google Analytics

Visit to activate access to Google Analytics. If you are logging in for the very first time, you will be greeted with the following image:

Upon entering the signup form, feel free to include as much information as possible. Note that the "Website URL" does not have to a real URL, and that you can always come back to modify this value:

This effectively creates a "data stream," which serves as a direct line of communication between the web browser accessing our websites and the Google Analytics server. You can refer to a section called "Tagging Instructions" to retrieve the code snippet:

Copy the provided code, and ensure that each web page contains the snippet in the <head> section:

The website should be now fully tracked by Google Analytics. You can verify this by visiting the website on multiple (different) browsers your local machine, and checking the "Real-Time" tab:

If you can verify that the number rises above 0, we can confirm that Google Analytics is indeed active. Not working? This may be due to delay in Google's server, and you may safely continue on if you can confirm that the code is placed correctly. Upon verifying that the code snippet has been inserted correctly, go ahead and ensure that all three files (index.html, about.html, and contact.html) are equipped with it.

Screencast Recording

Code Sample: index.html


        <link href="|Roboto:400,700" rel="stylesheet">
        <link rel="stylesheet" href="" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">
        <link rel="stylesheet" href="css/style.css">

        <!-- Global site tag (gtag.js) - Google Analytics -->
        <script async src=""></script>
          window.dataLayer = window.dataLayer || [];
          function gtag(){dataLayer.push(arguments);}
          gtag('js', new Date());

          gtag('config', 'UA-75268709-7');


        <div id="container">

            <div id="title">John Doe</div>

            <div id="menu">
                <a href="index.html">Home</a>
                <a href="about.html">About</a>
                <a href="contact.html">Contact</a>

            <div id="content">
                <img src="">
                <p>John Doe is a Toronto-based creative.</p>