How To Use Google Analytics For Tracking Website And App Performance

SSupported by cloud service provider DigitalOcean – Try DigitalOcean now and receive a $200 when you create a new account!
Listen to this article

Google Analytics focuses on event based tracking, privacy, and cross platform data, replacing older Universal Analytics. Setup is straightforward for beginners, it involves creating an account, adding a property and data stream, and installing tracking code, typically taking under an hour with tools like Google Tag Manager (GTM). Using plugins simplifies this for platforms like WordPress.

Google Analytics 4 (GA4), the current iteration of Google’s analytics platform, offers a robust, privacy focused tool for tracking website and app performance. Introduced in 2020 and fully replacing Universal Analytics by 2023, GA4 emphasizes event based data models, machine learning for predictive insights, and cross platform measurement across web, iOS, and Android.

Prerequisites for Getting Started

Before diving in, confirm you meet these basics:

  • A Google account (create one at accounts.google.com if needed).
  • Access to your website’s code or CMS (e.g., WordPress, Shopify) for installing tracking scripts.
  • Optional but recommended: A Google Tag Manager (GTM) account for advanced tracking without heavy coding.
  • Permissions: Viewer role for accounts, Editor for properties and streams.
  • Awareness of limits: Up to 2,000 properties per account, with options to increase via support.

If you’re migrating from older versions, note that GA4 does not retroactively apply to historical data, start fresh to build insights over time.

Step 1: Creating a Google Analytics Account and Property

  1. Navigate to analytics.google.com and sign in.
  2. Click “Start measuring” (or “Create Account” in Admin if existing).
  3. Enter an account name (e.g., your business name) and configure data sharing settings: opt in or out for Google products, benchmarks, and support.
  4. Create a property: Provide a name (e.g., “My Website”), select reporting time zone and currency (changes affect future data only; avoid frequent adjustments to prevent data anomalies).
  5. Specify industry category, business size, and objectives (e.g., “Generate more leads” for customized reports; select “Get baseline reports” for simplicity).
  6. Accept the Terms of Service and Data Processing Amendment (especially for GDPR regions).
  7. This sets up your GA4 property, the core unit for data collection.

Step 2: Adding a Data Stream

Data streams feed information from your site or app into GA4.

In Admin > Data Streams, click “Add stream.”

Choose platform: Web for websites, iOS/Android for apps.

  • For web: Enter URL (e.g., https://example.com) and stream name.
  • Enable Enhanced Measurement (default: on) for auto tracking of events like page views, scrolls, and clicks; customize via the gear icon (e.g., toggle off scrolls if manual tracking preferred).
  • For apps: Enter bundle/package name, app name, and IDs; download config file and add Firebase SDK.

Note the Measurement ID (G-XXXXXXXXXX) for installation.

Limits: Enhanced events have thresholds (e.g., scrolls at 90%); test for reliability.

Step 3: Installing the Tracking Code

Installation varies by method; choose based on your setup.

Manual Installation:

  1. In Data Streams > Your Stream > View tag instructions > Install manually.
  2. Copy the JavaScript snippet (gtag.js).
  3. Paste it immediately after the <head> tag on every page (use CMS tools like WordPress’ header editor).

Using Google Tag Manager (GTM):

  1. Create a GTM account at google.com.
  2. Add a new tag: Google Analytics > GA4 Configuration.
  3. Paste Measurement ID; set trigger to “Initialization – All Pages.”
  4. Preview and publish; add GTM snippets to your site’s <head> and <body>.

For WordPress (Plugin Method):

  1. Install MonsterInsights or WPCode via dashboard.
  2. Connect GA4 via the plugin wizard (auto creates stream) or paste code in Header section.

Verification:

  1. Use GTM Preview mode or GA Debugger Chrome extension.
  2. Check Admin > DebugView for events (enable debug_mode).
  3. Monitor Realtime report for traffic (may take 15-30 minutes; full data in 24-48 hours).
  4. Troubleshooting: Clear cache, check for typos, ensure no ad blockers interfere.
Installation Method Pros Cons Best For
Manual (gtag.js) Simple, no extra tools Requires code access on all pages Small sites without CMS
Google Tag Manager Flexible for custom events Learning curve Sites needing advanced tracking
Plugin (e.g., MonsterInsights) Easy setup, dashboard reports Platform specific (e.g., WordPress) Beginners on popular CMS

Step 4: Navigating the GA4 Interface

GA4’s dashboard is intuitive but data driven, familiarize yourself early.

  1. Home Page: Personalized overview with metrics like users, sessions, and suggestions; hover to change views, adjust date ranges (default: last 7 days).
  2. Admin Section: Bottom left; manage properties, users, and settings (e.g., data retention up to 14 months).
  3. Reports Menu: Left sidebar; includes:
    Realtime: Live user activity (last 30 minutes; useful for testing).
    Reports Snapshot: High level summary.
  4. Use the top search bar for natural queries (e.g., “users from UK last month”).
  5. Customize: Click pencil icon to add dimensions/metrics; save as new reports in Library.
  6. Mobile Access: Install the Analytics app for on the go metrics.

Step 5: Understanding Key Metrics

Metrics quantify user behavior; focus on these for beginners:

Metric Description Example Use Source
Users Unique visitors (new vs. returning) Track audience growth; calculate return rate as (returning / total) x 100 Retention report
Sessions User interactions within a time frame Measure visit frequency Traffic Acquisition
Pageviews (Views) Total page loads Identify popular content Engagement > Pages
Engaged Sessions Sessions with meaningful interaction (e.g., >10s, event, or conversion) Gauge content quality Engagement reports
Bounce Rate Single page sessions without interaction Optimize landing pages Landing Page report
Conversions (Key Events) Marked important actions (e.g., purchase) Evaluate business goals Monetization/Acquisition

Predictive metrics (e.g., purchase probability) use ML for forecasts, enable in settings.

Step 6: Tracking Events and Conversions

Events are the heart of GA4, flexible and parameter-rich.

Event Categories:

  • Automatically Tracked: first_visit, session_start, user_engagement.
  • Enhanced Measurement: page_view, scroll (90%), outbound clicks, site search, video progress, file downloads (toggle in stream settings).
  • Recommended: Predefined like login, share (use exact names for best practices).
  • Custom: For unique actions (e.g., button clicks).

Setting Up Custom Events:

  1. In GTM, enable variables (e.g., Click URL).
  2. Create GA4 Event tag with name (snake_case, ≤40 chars) and parameters (up to 25).
  3. Assign trigger (e.g., class based clicks).
  4. Test in Preview/DebugView.

Marking Key Events (Conversions):

  1. In Admin > Events, toggle star for existing events or create new (e.g., derive from page_view on thank-you page).
  2. Up to 30 per property; add value/currency for monetized events.
  3. Data appears in reports after 24 hours; realtime in minutes.
  4. Limits: 50 custom dimensions, no total event cap.
Event Type Examples When to Use Auto Enabled?
Automatic first_visit, session_start Basic user starts Yes
Enhanced scroll, outbound click, file_download Common interactions Optional (default on)
Recommended add_to_cart, view_search_results Ecommerce/social No, manual setup
Custom menu_link_click, preorder_button Site specific No, via GTM

Step 7: Exploring Reports and Analysis

Reports evolve with data; start basic, then customize.

Key Collections:

  • Life Cycle: Acquisition (traffic sources), Engagement (pages/events), Monetization (revenue), Retention (user loyalty).
  • User: Demographics (age/gender, requires Google Signals), Tech (devices/browsers).
  • Others: App specific, games, or business objectives based.

Browsing Reports:

  • Overviews: Summaries (e.g., revenue).
  • Details: In depth (e.g., ecommerce purchases).
  • Customize: Add secondary dimensions (e.g., source + page path), filters.

Explorations (Advanced Analysis):

  1. In Explore > Template gallery.
  2. Types: Free Form (tables/charts), Funnel (journeys), Path (user flows), Segment Overlap (comparisons), Cohort (grouped by attributes).
  3. Build: Add segments, dimensions (e.g., country), metrics (e.g., conversions).

Data Import: Upload CSV from CRM (Admin > Data Import); types include user data, offline events (limit: 10GB/day).

Step 8: Managing Access and Integrations

  1. Add users: In Admin > Account Access Management; assign roles (Viewer for read only, Editor for setup).
  2. Link to Google Ads: For ad performance and bidding on conversions.
  3. Enhance: Import conversions to Ads, enable Signals for demographics.

Step 9: Best Practices and Troubleshooting

  • Plan events in a spreadsheet: Name, type, parameters.
  • Avoid common pitfalls: Typos in IDs, ignoring debug tools, over relying on realtime (inaccurate).
  • Privacy: Use cookieless options, no IP storage; update policies.
  • Tips: Wait 24-48 hours for reports; register custom dimensions; focus on actionable data (ask “Why track this?”).
  • Troubleshooting: Check console for errors, use incognito, extend data retention.
  • Advanced: Integrate with BigQuery for raw data (free tier available).
,