GA4 Tutorial for Beginners
A GA4 tutorial teaches how to set up and use Google Analytics 4, Google's web and app analytics tool. GA4 records what visitors do on a website as events, such as viewing a product, adding it to the cart or buying it, and turns them into reports that show which marketing brings sales.
- Event-based: Every action is an event, from a page view to a purchase, instead of the old sessions and hits model.
- Key events: You mark the events that matter to the business, such as purchases and leads, as key events.
- Cross-platform: One property can collect data from a website and a mobile app together.
- Built-in AI: GA4 flags unusual changes as insights and can predict purchase likelihood for some sites.
- Privacy-aware: It works with consent banners through Consent Mode and can model missing data.
This tutorial follows one example: a D2C tea brand from Assam that sells online, accepts UPI and cards through a payment gateway, and is preparing for its Diwali sale. The owner wants to know which channel, Instagram ads, Google search or WhatsApp broadcasts, brings the most orders.
Prerequisites for This GA4 Tutorial
- A Google account: Use a business account that more than one person in the company can access, not a personal one that leaves with an employee.
- Website access: Admin access to the site builder (such as Shopify or WordPress) or to the site's code.
- Checkout details: Know how the checkout works, including whether customers leave the site to pay through a payment gateway.
- A consent banner, if needed: If the site collects data from users in regions that require consent, plan it with the Consent Mode lesson.
Setup: Create a GA4 Property
- Go to analytics.google.com and select Start measuring.
- Account: Name it after the company, for example "Assam Tea Co". One account can hold several properties.
- Property: Name it after the website, set the reporting time zone to India and the currency to Indian Rupee (INR). Revenue reports use this currency.
- Business details: Choose the industry and size, then pick the business objectives closest to the goal, such as generating sales. These choices decide which reports appear by default.
- Data stream: Choose Web, enter the site address and a stream name. GA4 creates a Measurement ID that starts with "G-".
- Enhanced measurement: Leave it on. It records page views, scrolls, outbound clicks, site search, video engagement, file downloads and form interactions without extra code.
Step-by-Step: Track the Store Properly
Step 1: Install the Google Tag
There are three common ways to install the tag on every page:
- Platform integration: Shopify, WordPress plugins and most site builders ask only for the Measurement ID.
- Google Tag Manager: Best when several tags will be added later, covered in the Google Tag Manager tutorial.
- Direct code: Paste the Google tag snippet from the data stream page into the head of every page.
Step 2: Check Data Is Arriving
Open Reports > Realtime, visit the site from a phone, and confirm that the visit appears within a minute or two.
Step 3: Send the Purchase Event
A sale is recorded with the recommended purchase event. Platform integrations usually send it for you. On a custom checkout, the developer sends it on the order confirmation page with the order details:
gtag("event", "purchase", {
transaction_id: "AT-10482",
value: 1198.0,
currency: "INR",
items: [
{ item_id: "ASSAM-CTC-500", item_name: "Assam CTC Tea 500 g", price: 599.0, quantity: 2 }
]
});- transaction_id: A unique order number. GA4 uses it to avoid counting the same order twice if the page is reloaded.
- value and currency: The order total and "INR", so revenue appears correctly in reports.
- items: The products in the order, used by the ecommerce reports.
Step 4: Mark Purchase as a Key Event
Go to Admin > Data display > Events, find purchase, and mark it as a key event. Do the same for other important actions, such as a wholesale enquiry form. The design of events is covered in GA4 events and conversions.
Step 5: Fix Payment Gateway Referrals
When a customer pays by UPI through a payment gateway and returns to the thank-you page, GA4 may credit the sale to the gateway's website instead of the ad that brought the customer. Add the gateway's domain under Admin > Data streams > Configure tag settings > List unwanted referrals.
Step 6: Set Data Retention and Internal Traffic
- Data retention: Under Admin > Data collection and modification > Data retention, change event data retention from 2 months to 14 months.
- Internal traffic: Define the office IP address as internal traffic and activate the filter, so the team's own visits do not inflate the numbers.
Step 7: Tag Campaign Links
Add UTM parameters to every Instagram, WhatsApp and email link for the Diwali sale, such as utm_source=whatsapp and utm_campaign=diwali_sale. Without them, broadcast clicks often appear as direct traffic.
Step 8: Read the First Reports
| Report | Where to find it | Question it answers for the tea brand |
|---|---|---|
| Realtime | Reports > Realtime | Is the Diwali sale traffic arriving right now? |
| Traffic acquisition | Reports > Acquisition | Which channels bring visits and purchases? |
| Pages and screens | Reports > Engagement | Which product pages get the most views? |
| Ecommerce purchases | Reports > Monetization | Which teas sell most, and for how much revenue? |
| Explorations | Explore | Where do people leave between cart and purchase? |
Common Mistakes
- Tag on some pages only: Missing the tag on the thank-you page means purchases are never recorded.
- Duplicate purchases: Sending the purchase event without a transaction ID, or both from the platform and custom code, counts orders twice.
- Wrong currency: Leaving the property in US dollars makes every revenue figure misleading.
- Short retention: Keeping the default 2 months limits detailed analysis of the previous festive season.
- Untagged links: WhatsApp and email clicks without UTM parameters are credited to the wrong source.
- Personal data in events: Never send names, phone numbers or email addresses to GA4; Google's policies forbid it and so does good privacy practice.
Next Steps
- Events in depth: Plan custom events such as add to wishlist in GA4 events and conversions.
- Dashboards: Share a weekly sales view with the team through the Looker Studio dashboard tutorial.
- Organic traffic: Link GA4 with Search Console to see which searches bring buyers, explained in what is SEO.
How AI Changes GA4 Analysis
What AI Automates Now
GA4 itself detects unusual changes, such as a sudden drop in purchases, and shows them as insights. For sites with enough purchase data it predicts purchase and churn probability, covered in GA4 predictive metrics. General AI assistants can also summarise exported reports and suggest explanations.
What Still Needs a Human
Deciding which events matter, checking that tracking is correct, and judging whether a pattern is real or a tracking fault all need a person who knows the business. An AI summary cannot know that the checkout was down for an hour on Diwali.
Risk to Watch
AI tools will confidently explain numbers that are wrong because the tracking is wrong. Check data quality before asking for insights, and never upload exports containing customers' personal data into AI tools, in line with the DPDP Act.
Do It with AI
Use this prompt to get a first read of a GA4 export. It works in ChatGPT, Claude or Gemini. Export the Traffic acquisition report as CSV first and remove any personal data.
You are a marketing analyst for a D2C brand in India. Below is a GA4 Traffic acquisition export for [date range], with sessions, key events and revenue in INR by session source and medium. [paste the CSV] 1. Rank the channels by revenue and by key events per session. 2. Point out any channel whose share of sessions is much larger than its share of revenue, or the reverse. 3. List likely tracking problems, such as payment gateway domains appearing as sources or a high share of direct traffic. 4. Suggest three questions I should check in GA4 before acting on these numbers. Use only the numbers in the export. Do not invent benchmarks or industry averages.
- Export the report for the sale period and a normal period for comparison.
- Remove any column that could identify a person.
- Run the prompt and read the tracking problems first.
- Confirm each finding in GA4 before moving budget between channels.
Check Before You Use It
- Facts: Recalculate one or two figures by hand; AI tools can misread CSV columns.
- Brand fit: Judge the suggestions against what the team knows about the sale, stock and offers.
- Compliance: Share no personal data with AI tools, and follow the company's data policy for what may be uploaded.
Quick Quiz
Pick an answer to check yourself. Nothing is saved.
Question 1 / 3
1. In GA4's structure, what sits directly under a property?
Frequently Asked Questions
Does GA4 cost anything?
The standard version of Google Analytics 4 has no fee and suits most small and medium businesses. Google also sells a paid version, Google Analytics 360, with higher limits and support for large companies.
What is the difference between an event and a key event in GA4?
An event is any action GA4 records, such as a page view, a scroll or an add to cart. A key event is an event you mark as important to the business, such as a purchase or a lead form submission. Key events were called conversions in GA4 until Google renamed them.
Why does GA4 show fewer visits than my website platform?
Common reasons are visitors who decline cookies or block trackers, pages where the Google tag is missing, and different definitions of a visit. Small differences are normal; a large gap usually means the tag is missing from some pages.
How long does GA4 keep my data?
Detailed event data in Explorations is kept for 2 months by default, and the standard version lets you raise this to 14 months under data retention settings. Change it on day one, because the setting does not apply to data already deleted.
Should I install GA4 directly or through Google Tag Manager?
For a simple site, the Google tag or the platform's built-in integration is enough. Google Tag Manager is better when you will add several tracking tags, such as Meta Pixel and Google Ads conversion tags, because they can be managed in one place without editing site code.
Related Articles
- GA4 Events and ConversionsGA4 events explained: automatic, enhanced, recommended and custom events, and how to mark key events, with a coaching institute example and an AI prompt.
- Google Tag Manager TutorialGoogle Tag Manager tutorial: set up tags, triggers, variables, the dataLayer and preview mode step by step, with a Jaipur restaurant booking example.
- UTM ParametersUTM parameters explained: the five tags, a naming convention template and real link examples, so every Diwali sale click lands in the right GA4 channel.
- Looker Studio Dashboard TutorialLooker Studio tutorial: connect GA4, Google Ads and Sheets, add scorecards, charts and filters, and share a clear dashboard, with a Chennai clinic example.
- GA4 Predictive Metrics and AI InsightsGA4 predictive metrics explained: purchase and churn probability, predicted revenue, eligibility and insights, with a skincare brand example and AI prompt.
- Consent Mode v2Consent Mode v2 set up step by step: basic vs advanced mode, the four consent parameters and a working gtag example, so Google tags respect every visitor.