> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sherpo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Analytics

> Pipe Sherpo traffic and conversion events into GA4 with a simple Measurement ID.

Sherpo's Google Analytics integration streams page views and checkout events from your site to GA4. That means you can track which marketing channels drive purchases, monitor funnels, and build audiences without adding JavaScript snippets manually.

***

## What Sherpo sends

* **Page views**: Every public page (landing pages, product pages, checkout, etc.) fires a standard `page_view` event.
* **Purchase events**: When a checkout succeeds, Sherpo sends a `purchase` event with value, currency, items, coupon code, and transaction ID.
* **Custom events**: Sherpo tags key milestones (e.g., `begin_checkout`, `select_content`) so you can build conversion funnels inside GA4.

Events follow GA4 naming conventions and include user properties (client ID, session ID) so GA can deduplicate and attribute correctly.

***

## Connect GA4 to Sherpo

1. In GA4, go to **Admin -> Data streams -> Web** and create (or open) the stream for your Sherpo site.
2. Copy the **Measurement ID** (format: `G-XXXXXXXXXX`).
3. In Sherpo, open **Organization -> Integrations**.
4. Select **Google Analytics** and click **Configure**.
5. Paste the Measurement ID and save.

Sherpo immediately starts sending events for the current site (space). Repeat for each site if you run multiple storefronts.

***

## Verify data

* In GA4, open **DebugView**. Add `?debug_mode=true` to your Sherpo site URL and browse around; events should appear within seconds.
* Alternatively, use GA4's **Realtime** report to confirm page views and conversions.
* If you don't see data, double-check the Measurement ID and make sure you added the correct domain in your GA4 stream.

***

## Using GA4 reports

* Build conversion funnels that start on landing pages and end with the Sherpo `purchase` event.
* Filter by `session_source/medium` to understand which campaigns drive the most Sherpo revenue.
* Use Audiences to retarget visitors who started checkout but didn't finish (Sherpo sends `begin_checkout` events you can use as conditions).

***

## Best practices

* Keep separate data streams (Measurement IDs) for each Sherpo site or custom domain so reporting stays clean.
* Combine GA4 with Sherpo's Meta Conversions and automation hooks to see a complete picture across ad platforms.
* Document which Measurement ID maps to which site so teammates configure the right one when duplicating spaces.

Once GA4 is connected, every Sherpo page and checkout automatically feeds into your analytics stack-no extra scripts or Google Tag Manager setup required.
.
