Ga4 Implementation

ga4-implementation.md

Markdown 6.9 KB 305 lines 29 sections

GA4 Implementation Reference

Detailed implementation guide for Google Analytics 4.

Contents

  • Configuration (data streams, enhanced measurement events, recommended events)
  • Custom Events (gtag.js implementation, Google Tag Manager)
  • Conversions Setup (creating conversions, conversion values)
  • Custom Dimensions and Metrics (when to use, setup steps, examples)
  • Audiences (creating audiences, audience examples)
  • Debugging (DebugView, real-time reports, common issues)
  • Data Quality (filters, cross-domain tracking, session settings)
  • Integration with Google Ads (linking, audience export)

Configuration

Data Streams

  • One stream per platform (web, iOS, Android)
  • Enable enhanced measurement for automatic tracking
  • Configure data retention (2 months default, 14 months max)
  • Enable Google Signals (for cross-device, if consented)

Enhanced Measurement Events (Automatic)

EventDescriptionConfiguration
page_viewPage loadsAutomatic
scroll90% scroll depthToggle on/off
clickOutbound link click (outbound: true); cross-domain measurement domains are excludedToggle on/off
view_search_resultsSearch results page with a configured search query parameterConfigure query parameters
video_start, video_progress, video_completeEmbedded YouTube start, progress and completionToggle on/off; JS API support required
file_downloadPDF, docs, etc.Configurable extensions

Use these exact names in event filters and triggers. The option labels "outbound clicks", "site search" and "video engagement" are not automatic event names. For video, report starts, progress milestones and completions separately; adding all three counts double-counts a viewing journey. A custom event with one of the old labels needs its own implementation. Verify enabled options and observed parameters in DebugView before expecting data.

Contract: Google enhanced measurement events.

Use Google's predefined events when possible for enhanced reporting:

All properties:

  • login, sign_up
  • share
  • search

E-commerce:

  • view_item, view_item_list
  • add_to_cart, remove_from_cart
  • begin_checkout
  • add_payment_info
  • purchase, refund

Games:

  • level_up, unlock_achievement
  • post_score, spend_virtual_currency

Reference: https://support.google.com/analytics/answer/9267735


Custom Events

gtag.js Implementation

B0

Google Tag Manager (dataLayer)

B1


Conversions Setup

Creating Conversions

  1. Collect the event - Ensure event is firing in GA4
  2. Mark as conversion - Admin > Events > Mark as conversion
  3. Set counting method:
  • Once per session (leads, signups)
  • Every event (purchases)
  1. Import to Google Ads - For conversion-optimized bidding

Conversion Values

B2

Or set default value in GA4 Admin when marking conversion.


Custom Dimensions and Metrics

When to Use

Custom dimensions:

  • Properties you want to segment/filter by
  • User attributes (plan type, industry)
  • Content attributes (author, category)

Custom metrics:

  • Numeric values to aggregate
  • Scores, counts, durations

Setup Steps

  1. Admin > Data display > Custom definitions
  2. Create dimension or metric
  3. Choose scope:
  • Event: Per event (content_type)
  • User: Per user (account_type)
  • Item: Per product (product_category)
  1. Enter parameter name (must match event parameter)

Examples

DimensionScopeParameterDescription
User TypeUseruser_typeFree, trial, paid
Content AuthorEventauthorBlog post author
Product CategoryItemitem_categoryE-commerce category

Audiences

Creating Audiences

Admin > Data display > Audiences

Use cases:

  • Remarketing audiences (export to Ads)
  • Segment analysis
  • Trigger-based events

Audience Examples

High-intent visitors:

  • Viewed pricing page
  • Did not convert
  • In last 7 days

Engaged users:

  • 3+ sessions
  • Or 5+ minutes total engagement

Purchasers:

  • Purchase event
  • For exclusion or lookalike

Debugging

DebugView

Enable with:

  • URL parameter: ?debug_mode=true
  • Chrome extension: GA Debugger
  • gtag: 'debug_mode': true in config

View at: Reports > Configure > DebugView

Real-Time Reports

Check events within 30 minutes: Reports > Real-time

Common Issues

Events not appearing:

  • Check DebugView first
  • Verify gtag/GTM firing
  • Check filter exclusions

Parameter values missing:

  • Custom dimension not created
  • Parameter name mismatch
  • Data still processing (24-48 hrs)

Conversions not recording:

  • Event not marked as conversion
  • Event name doesn't match
  • Counting method (once vs. every)

Data Quality

Filters

Admin > Data streams > [Stream] > Configure tag settings > Define internal traffic

Exclude:

  • Internal IP addresses
  • Developer traffic
  • Testing environments

Cross-Domain Tracking

For multiple domains sharing analytics:

  1. Admin > Data streams > [Stream] > Configure tag settings
  2. Configure your domains
  3. List all domains that should share sessions

Session Settings

Admin > Data streams > [Stream] > Configure tag settings

  • Session timeout (default 30 min)
  • Engaged session duration (10 sec default)

Integration with Google Ads

Linking

  1. Admin > Product links > Google Ads links
  2. Enable auto-tagging in Google Ads
  3. Import conversions in Google Ads

Audience Export

Audiences created in GA4 can be used in Google Ads for:

  • Remarketing campaigns
  • Customer match
  • Similar audiences

Other references

From the same skill.

View all 3 →

Related skills

More from the same category.

View all