---
name: google-analytics-onboarding-basic
description: Use when setting up Google Analytics 4 (GA4) for the first time on a website, web app, or mobile app (Android/iOS) — creating a Google Analytics account, property, and data stream; installing the Google tag (gtag.js) or wiring the Firebase SDK for mobile; turning on enhanced measurement; configuring events and key events (formerly "conversions"); setting data retention; handling EEA consent; or linking Google Ads/BigQuery/Search Console. Use whenever someone wants to add analytics, measurement, or tracking to their app or site, asks "how do I set up Google Analytics / GA4," or needs a Measurement ID (G-XXXXXXXXXX).
title: google-analytics-onboarding-basic
canonical_url: https://skilld.dev/gh/hardikpthv/agent-skills/google-analytics-onboarding-basic
last_updated: 2026-09-30T03:34:43.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/data-streams-and-sdk.md](https://skilld.dev/api/skills-raw/hardikpthv/agent-skills/google-analytics-onboarding-basic/references/data-streams-and-sdk.md), [references/official-links.md](https://skilld.dev/api/skills-raw/hardikpthv/agent-skills/google-analytics-onboarding-basic/references/official-links.md), [references/onboarding-checklist.md](https://skilld.dev/api/skills-raw/hardikpthv/agent-skills/google-analytics-onboarding-basic/references/onboarding-checklist.md).
>
> If the user asked to install this Skill, run `npx skilld install hardikpthv/agent-skills/google-analytics-onboarding-basic`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/google-analytics-onboarding-basic`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/hardikpthv/agent-skills/google-analytics-onboarding-basic) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/google-analytics-onboarding-basic`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/google-analytics-onboarding-basic --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/google-analytics-onboarding-basic --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Google Analytics Onboarding (Basic)

## Overview

Take a website or app from zero to **GA4 collecting data you can trust**, following Google's official process. This skill is the **map and the SOP**: the right order, the web-vs-mobile fork that trips everyone up, the settings people forget, and the official links to confirm today's details.

**Core principle: Google reorganizes the GA Admin UI and renames things constantly** (e.g. "Conversions" became **Key events** in 2024). This skill carries *last-known* labels and values, but you **must open the live official page and re-verify** before trusting a specific path or name. Treat [references/official-links.md](https://skilld.dev/api/skills-raw/hardikpthv/agent-skills/google-analytics-onboarding-basic/references/official-links.md) as the source of truth, not this file.

This is the **Basic** tier: you *guide a human* through the GA and Firebase consoles. For hands-on automation — driving the GA Admin console with the Playwright MCP and scripting property/stream/key-event setup via the Admin API — use `google-analytics-onboarding-pro`.

## When to use

- "Set up Google Analytics / GA4 on my site or app"
- Creating a GA account, property, or data stream; finding the Measurement ID
- Installing the Google tag (gtag.js), wiring GA through Google Tag Manager, or adding the Firebase SDK to an Android/iOS app
- Turning on enhanced measurement, defining events, or marking **key events**
- Setting data retention, handling EEA consent, or linking Google Ads / BigQuery / Search Console

**Not for:** building dashboards/analysis *inside* GA4, ad-campaign setup in Google Ads, or non-Google analytics (Mixpanel, Amplitude, PostHog — different tools).

## Learn this first: the model

Get these four right and the rest follows:

- **Account → Property → Data stream.** An *account* is the top container (a company); a *property* is one product/brand's dataset; a *data stream* is a single source feeding it (one web, one Android, one iOS). Best practice: **one property, ≤3 streams** (web + Android + iOS) — not a separate property per platform.
- **The web/mobile fork.** **Web** is measured with the **Google tag (gtag.js)** or via **GTM**, identified by a **Measurement ID `G-XXXXXXXXXX`**. **Mobile (Android/iOS) is measured through Firebase** — the **Firebase SDK with Google Analytics**, configured by `google-services.json` / `GoogleService-Info.plist`. gtag.js does **nothing** for a native app.
- **Events are the data.** Four kinds: **automatically collected**, **enhanced measurement** (web, no code), **recommended** (predefined names you send), and **custom** (your own). Gate reporting on events, not page URLs.
- **Key events** (renamed from "Conversions" on 2024-03-21) are the events that matter to the business. You **mark** them in GA4; a Google Ads *conversion* is then created from a key event. Mark them or your "conversions" stay empty.

## First: re-verify the volatile bits

| What | Why it bites | Re-verify |
|------|--------------|-----------|
| Admin UI paths (Data streams, Data retention, Consent) | Google moves/renames panels often | the official setup pages |
| "Key events" vs "Conversions" label | Renamed 2024; old guides mislead | support.google.com/analytics/answer/9267568 |
| Data retention default | Defaults to **2 months** — usually wrong | support.google.com/analytics/answer/7667196 |
| Consent Mode **v2** (EEA) | EEA users drop from audiences/ads without it | developers.google.com/tag-platform/security/guides/consent |

Full annotated list: [references/official-links.md](https://skilld.dev/api/skills-raw/hardikpthv/agent-skills/google-analytics-onboarding-basic/references/official-links.md).

## The onboarding sequence

Follow the ordered guide in **[references/onboarding-checklist.md](https://skilld.dev/api/skills-raw/hardikpthv/agent-skills/google-analytics-onboarding-basic/references/onboarding-checklist.md)**. The phases:

1. **Create the account** (or reuse one) — name it, set data-sharing.
2. **Create the property** — reporting time zone, currency, industry; accept ToS. (Time zone/currency aren't retroactive — set them right the first time.)
3. **Add a data stream** — Web (enter URL) or App (Android/iOS, which **auto-links a Firebase project**).
4. **Install collection** — web: paste the **Google tag** in `<head>` (or deploy via GTM / CMS); mobile: add the Firebase config file + **Firebase SDK with Analytics**. Pick **one** delivery path per stream.
5. **Enhanced measurement & events** — leave enhanced measurement on (web); add recommended/custom events for the actions you care about. See [references/data-streams-and-sdk.md](https://skilld.dev/api/skills-raw/hardikpthv/agent-skills/google-analytics-onboarding-basic/references/data-streams-and-sdk.md).
6. **Mark key events** — flag the business-critical events.
7. **Data retention & consent** — set retention to **14 months**; configure **Consent Mode v2** if you have EEA users.
8. **Verify** — confirm hits in **Realtime** and **DebugView** before declaring done.
9. **(Optional) Link products** — Google Ads, BigQuery, Search Console.

## Quick reference

| Item | Last-known detail (re-verify!) |
|------|--------------------------------|
| Web measurement | Google tag (gtag.js) or GTM; **Measurement ID `G-XXXXXXXXXX`** |
| Mobile measurement | **Firebase SDK + Google Analytics** (never gtag.js) |
| Mobile config file | `google-services.json` (Android) / `GoogleService-Info.plist` (iOS) |
| Conversions | now called **Key events** (since 2024-03-21) |
| Data retention | default **2 months** → set to **14 months** |
| EEA requirement | **Consent Mode v2** (`ad_user_data`, `ad_personalization`) |
| Verify with | **Realtime** report + **DebugView** |

## Common mistakes

- **Trusting this file's labels/paths without re-checking the live page** — the Admin UI drifts. Always re-verify.
- **Expecting the Google tag (gtag.js) to track a mobile app** — native apps need the **Firebase SDK**.
- **Double-counting** — firing gtag.js *and* a GA4 tag in GTM for the same property. Use one path.
- **Leaving data retention at 2 months** — set 14 so Explorations keep history.
- **Forgetting to mark key events** — events flow but "conversions" stay empty in GA4 and Ads.
- **Skipping Consent Mode v2 in the EEA** — EEA users silently drop out of audiences and ad data.
- **One web stream per domain** instead of one stream with **cross-domain measurement** — breaks sessions.
- **Declaring success without checking Realtime/DebugView.**
