In this section, we will cover the initial setup of Google Analytics. This includes creating an account, setting up a property, and installing the tracking code on your website. By the end of this module, you will have Google Analytics up and running, ready to collect data from your website.

  1. Creating a Google Analytics Account

Steps to Create an Account:

  1. Sign in to Google Analytics:

    • Go to Google Analytics.
    • Sign in with your Google account. If you don't have one, create a new Google account.
  2. Create an Account:

    • Click on the Admin gear icon at the bottom left corner.
    • In the Account column, click Create Account.
    • Enter an account name. This can be your business name or any name that helps you identify the account.
  3. Configure Account Data Sharing Settings:

    • Choose which data sharing options you want to enable. These options allow you to share your data with Google to improve their services.
  4. Click Next to proceed to the property setup.

  1. Setting Up a Property

Steps to Set Up a Property:

  1. Enter Property Details:

    • Enter a property name (e.g., your website name).
    • Select your reporting time zone and currency.
  2. Advanced Options (Optional):

    • If you want to create a Universal Analytics property, click on Show advanced options.
    • Toggle the switch to create a Universal Analytics property and enter your website URL.
  3. Click Next to proceed to the business information setup.

  4. Enter Business Information:

    • Select your industry category.
    • Choose your business size.
    • Select how you intend to use Google Analytics with your business.
  5. Click Create to finalize the property setup.

  1. Installing the Tracking Code

Steps to Install the Tracking Code:

  1. Get the Tracking Code:

    • After creating the property, you will be directed to the Web stream details page.
    • Under Tagging Instructions, click on Global Site Tag (gtag.js).
    • Copy the provided tracking code.
  2. Add the Tracking Code to Your Website:

    • Paste the tracking code into the <head> section of every page you want to track.
    • Example:
      <!DOCTYPE html>
      <html lang="en">
      <head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>My Website</title>
          <!-- Global site tag (gtag.js) - Google Analytics -->
          <script async src="https://www.googletagmanager.com/gtag/js?id=YOUR_TRACKING_ID"></script>
          <script>
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());
            gtag('config', 'YOUR_TRACKING_ID');
          </script>
      </head>
      <body>
          <!-- Your website content -->
      </body>
      </html>
      
    • Replace YOUR_TRACKING_ID with the actual tracking ID provided by Google Analytics.
  3. Verify Installation:

    • Go back to Google Analytics and navigate to the Realtime report.
    • Visit your website and check if your visit is being tracked in the Realtime report.

  1. Practical Exercise

Exercise:

  1. Create a Google Analytics Account:

    • Follow the steps outlined above to create a new Google Analytics account.
  2. Set Up a Property:

    • Set up a new property for your website.
  3. Install the Tracking Code:

    • Add the tracking code to your website.
  4. Verify Installation:

    • Use the Realtime report to verify that your website visits are being tracked.

Solution:

  • Ensure you have followed each step correctly.
  • If your visits are not being tracked, check the following:
    • The tracking code is correctly placed in the <head> section of your website.
    • There are no typos in the tracking ID.
    • Your browser's JavaScript is enabled.

Conclusion

By completing this module, you have successfully set up Google Analytics for your website. You are now ready to start collecting and analyzing data to gain insights into your website's performance. In the next module, we will cover the basic implementation of Google Tag Manager, which will further enhance your ability to manage and deploy tracking codes.

© Copyright 2024. All rights reserved