GA4 Account Setup and Configuration
Detailed guide on creating GA4 account, setting up properties, configuring data streams and installing tracking code
Prerequisites
Before getting started, please ensure you have the following:
Valid Google Account
Website Management Permissions
Basic HTML Knowledge
Step 1: Create GA4 Account
Access Google Analytics
Set Account Information
Create Property
Set Up Data Stream
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
Real-time Report Check
Use Debug Tools
Check Data Quality
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.