Shopify new store 3-month $1/month trial plus $20 credit

GA4 Account Setup and Configuration

Detailed guide on creating GA4 account, setting up properties, configuring data streams and installing tracking code

Beginner
25 minutes
Lesson 2 of 7

Prerequisites

Before getting started, please ensure you have the following:

1

Valid Google Account

Ensure you have a Google account that can access Google Analytics
2

Website Management Permissions

Need ability to edit website HTML code or use tag manager
3

Basic HTML Knowledge

Understanding how to add tracking code to websites (optional, helpful for understanding)

Step 1: Create GA4 Account

1

Access Google Analytics

Open browser, visit analytics.google.com, log in with your Google account. If this is your first time, click "Start measuring".
2

Set Account Information

Enter account name (usually your company or organization name), select account data sharing settings. Recommend enabling all data sharing options to improve functionality.
3

Create Property

Enter property name (your website name), select reporting time zone and currency. Answer business questions to get relevant feature recommendations.
4

Set Up Data Stream

Select "Web" platform, enter website URL and data stream name. After creation, you will get a measurement ID (format: G-XXXXXXXXXX).

Step 2: Install Tracking Code

Global Site Tag (gtag.js)

Most common installation method, add code directly to website HTML

Add the following code to the <head> section of every page on your website:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XXXXXXXXXX');
</script>

Replace G-XXXXXXXXXX with your actual measurement ID

Google Tag Manager

Manage all tags through GTM, more flexible solution

Steps:

  • Create new tag in GTM
  • Select "Google Analytics: GA4 Configuration"
  • Enter your measurement ID
  • Set trigger to "All Pages"
  • Save and publish container

Step 3: Verify Installation

1

Real-time Report Check

In GA4 interface, navigate to "Reports" > "Realtime", then visit your website and check if you see your visit in real-time reports.
2

Use Debug Tools

Install Chrome extension "Google Analytics Debugger" or "Tag Assistant Legacy" to verify tags are firing correctly.
3

Check Data Quality

Wait 24-48 hours then check data in standard reports to ensure tracking is working properly.

Step 4: Basic Configuration

Set Up Conversion Events

Navigate to "Configure" > "Events" in GA4, create important conversion events:

  • purchase (Purchase)
  • sign_up (Sign Up)
  • contact (Contact)

Configure Audiences

Navigate to "Configure" > "Audiences", create custom audiences based on geography, device type, or user behavior.

Set Data Retention

Navigate to "Admin" > "Data Settings" > "Data Retention", select event data retention period (2 months or 14 months).

Common Issues & Solutions

Data Not Showing

Possible Causes:

  • Tracking code installation error
  • Incorrect measurement ID
  • Browser blocking tracking

Solutions:

  • Check code installation location
  • Verify measurement ID
  • Test in incognito mode

Duplicate Data

Possible Causes:

  • Multiple tracking codes installed
  • GTM and direct installation both exist

Solutions:

  • Remove duplicate tracking codes
  • Use only one installation method

Best Practices

Test Environment

Verify tracking code in test environment before production deployment.

Documentation

Document all configurations and custom settings for team collaboration.

Permission Management

Properly assign user permissions to ensure data security.

Regular Monitoring

Regularly monitor data quality and tracking status.

Chapter Summary

Congratulations! You have successfully set up your GA4 account and installed the tracking code. Your website is now collecting user data, which will appear in reports within 24-48 hours. Proper setup is the foundation for all subsequent analysis work, so please ensure the tracking code is working properly before proceeding to the next lesson.

In the next chapter, we will learn how to view Google Ads reports in GA4 and understand paid advertising performance analysis.