> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.seotesting.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How Google Analytics Event Tracking Works on SEO Tests

When you set up Google Analytics event tracking on an SEO test in SEOTesting, a common question is whether the tracked events are scoped to the specific test page or across the entire site. This article explains how it works.

## Landing Page-Based Tracking

Event tracking on tests is based on the **landing page** — the first page a user visits when they arrive on your site from a search engine. SEOTesting uses Google Analytics 4's `landingPagePlusQueryString` dimension, which is session-scoped. This means:

* The URL in your test is matched against the **entry point** of the user's session
* Any key events the user triggers during that session are attributed to that landing page, **even if the user navigates to other pages before completing the event**

## A Practical Example

1. A user clicks a Google search result and lands on `/product-shoes` (your test URL)
2. The user browses to `/sizing-guide` and then `/checkout`
3. The user completes a purchase on `/checkout`, triggering a `purchase` key event

In this scenario, the `purchase` key event **is counted for your test** because the session started on your test URL.

## What Isn't Counted

Sessions where the user enters your site on a **different page** and then navigates to your test URL are **not** counted. The test URL must be the landing page — the very first page viewed in the session.

For example:

1. A user lands on `/homepage` from Google
2. They navigate to `/product-shoes` (your test URL)
3. They complete a purchase

This session's events would **not** be counted for the test, because `/product-shoes` was not the landing page.

## Why It Works This Way

This behaviour comes from how Google Analytics 4 scopes its dimensions:

* **Session-scoped dimensions** (like `landingPage`) capture a single value for the entire session — the first page viewed. All events in that session are grouped under that value.
* **Event-scoped dimensions** (like `pagePath`) capture the specific page where each individual event occurred.

SEOTesting uses the session-scoped landing page dimension because it aligns with how SEO tests work — you're measuring the impact of changes to a page that users find through search, and you want to capture the full downstream value of that visit.

## Summary

| Scenario | Counted in test? |
| ---- |
| User lands on test URL from Google, triggers key event on that page | Yes |
| User lands on test URL from Google, navigates elsewhere, then triggers key event | Yes |
| User lands on a different page, navigates to test URL, then triggers key event | No |

The key takeaway: tracking is tied to sessions that **start** on your test URL, and captures all key events within those sessions regardless of which page the event fires on.
