Setting Up Google Analytics for the First Time

Jul 1, 2024

Setting Up Google Analytics for the First Time

Overview

  • Creating a new Google Analytics property and website.
  • Adding the necessary code to the website to send events to Google Analytics.
  • Viewing events and reports in the Google Analytics UI.

Steps to Set Up Google Analytics

1. Create a Google Analytics Property

  • Accounts and Property: Ensure you have a Google Analytics account and create a property.
  • Data Stream: Set up a data stream as the source of data for processing.
    • Types of streams: Web or App (focus on Web for this tutorial).
    • Enable Enhanced Measurement for automatic event tracking (page views, clicks, downloads, etc.).
    • Creation of the stream requires a Measurement ID for tagging.

2. Set Up Google Tag Manager

  • Access Tag Manager: From Google Analytics, click the Tag Manager icon to go to the Google Tag Manager homepage.
  • Account Creation: Create a new account with the website URL.
  • **Add Code to Website: **
    • Copy the snippet for the head section.
    • Copy the snippet for the body section.
    • Paste these snippets into the HTML file of the website (e.g., using Visual Studio Code).

3. Configuring Tags and Triggers

  • Set Up a New Tag:
    • Navigate to Tags in Google Tag Manager and create a new tag.
    • Select Google Analytics GA4 Configuration and enter the Measurement ID.
    • Set the trigger to load the tag on every page.
    • Rename and save the tag.
  • Publish the Tag: Submit and publish the changes.

Verify the Setup

  • Checking the Website: Access the website, open developer tools (network tab) to ensure GTM container and GA tag loads.
  • Google Analytics: Return to Google Analytics, go to Reports -> Real-time to verify data is being sent.

Conclusion

  • The demo website’s code is available on GitHub for followers to practice.
  • Join the Discord server for questions and community support.

Happy Measuring!