quest_set_up_ga4_from_scratch.exe
_
×

Set Up GA4 From Scratch: The Complete Guide

Everything you need to deploy Google Analytics 4 the right way — property structure, key events, essential settings and the pitfalls to avoid.

ga4 analytics guide

Google Analytics 4 fundamentally changed the way we measure a website. If you’re coming from Universal Analytics, the paradigm shift can be disorienting. This guide covers everything you need to start on solid ground.

Why GA4 is different from Universal Analytics

UA was built on sessions and pageviews. GA4 is built on events and parameters. Everything is an event: a pageview, a click, a scroll, a conversion.

This approach is far more flexible, but it demands more upfront thinking about what you actually want to measure.

1. Create the GA4 property

In Google Analytics, create a new property:

  1. Account → Property → Data stream
  2. Choose “Web”
  3. Enter your URL and the stream name
  4. Note your Measurement ID (format G-XXXXXXXXXX)

Don’t spin up multiple streams for the same site without a reason. One web stream per property is the norm.

The recommended way to deploy GA4 is through Google Tag Manager.

GA4 configuration tag

// In GTM, create a "Google Analytics: GA4 Configuration" tag
// Measurement ID: G-XXXXXXXXXX
// Trigger: All Pages (Initialization)

Parameters to set every single time:

ParameterValueWhy
debug_modetrue (dev only)Turns on real-time debugging
send_page_viewfalseManual control over pageviews

page_view tag

Create a separate GA4 Event tag for pageviews:

// Tag: GA4 - page_view
// Event Name: page_view
// Trigger: All Pages (Page View)

Splitting the config from the page_view gives you far more control on SPAs.

3. The automatic events worth knowing

GA4 collects some events automatically:

  • session_start — start of a session
  • first_visit — first-time visitor
  • page_view — if send_page_view: true
  • scroll — 90% scroll depth
  • click — outbound clicks

Plus the Enhanced Measurement events (turn them on in the stream settings):

  • file_download — downloads
  • video_start, video_complete — YouTube videos
  • form_submit — form submissions

4. Structuring custom events

The GA4 naming convention: snake_case, verb_object.

purchase          ✅
add_to_cart       ✅
newsletter_signup ✅
ButtonClick       ❌ (PascalCase)
btn-click         ❌ (kebab-case)

Event parameters

Each event can carry up to 25 parameters:

gtag('event', 'newsletter_signup', {
  source: 'hero_cta',
  page_location: window.location.href,
  page_title: document.title,
});

A critical gotcha: to show up in your reports, parameters must be registered as Custom Dimensions under GA4 Admin → Custom Definitions.

5. Set up conversions

In GA4, conversions are configured under Admin → Events → Mark as conversion.

The events worth marking:

  • purchase
  • generate_lead
  • newsletter_signup
  • form_submit

GA4 has no Goal Funnels like UA did. Conversion funnels are built in Explore → Funnel Exploration.

6. Verify with DebugView

To check your setup in real time:

  1. Enable debug mode through GTM Preview
  2. Open GA4 → Configure → DebugView
  3. Browse your site
  4. Events show up in near real time
// You can also force debug_mode from the URL
// Add ?gtm_debug=x to your URL in GTM Preview

7. Essential settings to configure

Data retention

By default, GA4 keeps data for 2 months. Change this right away:

Admin → Data Settings → Data Retention → 14 months

Internal IP filters

Admin → Data Streams → Configure tag settings → Define internal traffic

Add your office/VPN IPs so they don’t pollute your data.

Connect to Google Search Console

Admin → Product Links → Search Console Links

This link pulls organic search data straight into GA4.

Conclusion

A solid GA4 setup takes time, but it’s an investment that pays off. The two most common mistakes:

  1. Deploying on autopilot — never checking that events actually come through
  2. Ignoring Custom Dimensions — collecting event parameters that never surface in your reports

In an upcoming article, we’ll look at how to export raw GA4 data to BigQuery for deeper analysis.