analyticslanding-pagesga4tracking

GA4 Landing Page Query String Tracking: Full Tutorial

Published July 7, 2026PagePulse Team

GA4 Landing Page Query String Tracking: The Complete Tutorial

If you run A/B tests or paid campaigns, GA4 landing page query string tracking is the fastest way to see which variant, source, or offer actually pulls its weight. Out of the box, GA4 strips query parameters from the default Landing Page report, so /pricing?variant=b and /pricing?variant=a look identical. Here is how to fix that.

Quick answer: GA4 hides query strings from the Landing Page dimension by default. To track them, either use the Page path + query string dimension in Explore, register variant (or any custom param) as a custom dimension in Admin, or build a Looker Studio report using Landing page + query string. All three take under 15 minutes.

Why does GA4 hide query strings by default?

Google made this choice to keep the Pages report clean. If every UTM string counted as a unique page, your reports would balloon into thousands of near-duplicate rows.

The tradeoff: landing page performance data becomes useless for anyone running variants, campaign splits, or personalization. If you use ?ref=, ?variant=, ?utm_content=, or any custom parameter to differentiate versions of the same URL, you need to opt back in.

Google's own GA4 dimensions and metrics reference confirms that Landing page and Landing page + query string are two distinct dimensions. You have to pick the second one intentionally.

How do you see query strings in the Landing Page report?

The default Landing Page report in the left nav does not support query strings. You need Explore. Here is the flow:

  1. Open Explore in the left sidebar
  2. Create a Free form exploration
  3. Under Dimensions, click the + and add Landing page + query string
  4. Under Metrics, add Sessions, Conversions, and Session key event rate
  5. Drag Landing page + query string into Rows, and your metrics into Values
  6. Filter for the pages you care about (e.g. contains /pricing)

Now /pricing?variant=a and /pricing?variant=b show up as separate rows with their own conversion rates.

If you want this view permanently, save the exploration and share it with your team. Explore reports do not appear in the standard nav, so bookmark the URL.

How do you track a specific parameter as a custom dimension?

The Landing page + query string dimension shows the full URL, which is noisy. If you only care about one parameter, say variant, register it as a custom dimension. Then you can group and filter by just that value.

Step 1: Capture the parameter as an event parameter

GA4 automatically parses common UTM parameters into event params like campaign, source, medium, and content. For custom params like variant or ref, you have two options:

  • Google Tag Manager: Create a URL variable that reads the variant query parameter, then attach it as an event parameter to your page_view event
  • gtag.js: Modify your config snippet to send variant explicitly:
gtag('config', 'G-XXXXXXX', {
  variant: new URLSearchParams(window.location.search).get('variant')
});

Step 2: Register it in Admin

Go to Admin → Custom definitions → Create custom dimension. Set:

  • Dimension name: Variant
  • Scope: Event
  • Event parameter: variant

Save. Data starts collecting from that moment forward. It does not backfill.

Step 3: Wait 24-48 hours, then use it in reports

Custom dimensions take up to a day to populate. Once they do, they appear in Explore under Custom dimensions and can be added to any report.

How do you compare A/B test variants in GA4?

This is the whole reason most people set up query string tracking. Once you have variant as a custom dimension, here is the comparison report:

  1. In Explore, create a Free form report
  2. Rows: Variant (your custom dimension)
  3. Columns: none (or add Device category if you want a split)
  4. Values: Sessions, Key events, Session key event rate
  5. Filter: Landing page exactly matches /your-test-page

You now have variant-by-variant conversion rates for that specific page.

Watch out for two gotchas:

  • Sample size: GA4 conversion rate numbers are noisy under a few hundred sessions per variant. See our guide on A/B testing landing pages without wasting traffic for minimum sample calculations.
  • Attribution: Session key event rate counts any conversion in that session, not just the one triggered by the landing page. If a user lands on variant A, leaves, comes back via variant B, then converts, only variant B gets credit.

For a deeper walkthrough of test design itself, our complete A/B testing guide for landing pages covers what to test and how to interpret results.

What is the difference between Page path, Page location, and Landing page dimensions?

This trips up almost everyone. Here is the cheat sheet:

DimensionIncludes query string?Includes hostname?What it represents
Page pathNoNoJust the path, e.g. /pricing
Page path + query stringYesNoPath with params, e.g. /pricing?variant=b
Page locationYesYesFull URL
Landing pageNoNoFirst page of the session, path only
Landing page + query stringYesNoFirst page of the session, with params

Use Landing page + query string when you want to know which entry URL drove the session. Use Page path + query string when you want to know which URLs got viewed at any point during the session.

How do you set this up in Looker Studio?

If your team lives in dashboards, replicate the Explore setup in Looker Studio:

  1. Connect GA4 as a data source
  2. Add a table chart
  3. Dimension: Landing page + query string (or your custom Variant dimension)
  4. Metrics: Sessions, Conversions, Session conversion rate
  5. Add a date range filter and a page path filter

The advantage over Explore: you can schedule email delivery, share view-only links, and combine GA4 data with Search Console or ad platform data in one view.

How should you name query parameters for tracking?

A few rules that will save you pain later:

  • Lowercase everything. GA4 is case sensitive. ?Variant=A and ?variant=a are different values.
  • Keep parameter names short and consistent. Pick variant, ref, offer and stick with them across every campaign.
  • Do not overlap with UTMs. Do not put your test variant in utm_content if you are also using utm_content for ad creative IDs. Use a separate custom param.
  • Document your convention. A README in your marketing repo with "parameter names we use and what they mean" prevents six months of confusion.

If your heatmap tool also supports URL filtering, matching parameter names between GA4 and your heatmap makes cross-tool analysis much easier. Our heatmap tools comparison covers which tools handle URL parameters well.

What data will not backfill, and what will?

Critical point: custom dimensions only capture data from the moment you register them. If you launched a test three weeks ago and just now added variant as a custom dimension, you have three weeks of blind data.

What backfills:

  • Landing page + query string: available historically because GA4 stores the full page location on every event
  • Standard UTM parameters (source, medium, campaign): captured automatically

What does not backfill:

  • Custom dimensions from custom event parameters: only forward from registration

Always register custom dimensions before you launch a test.

Frequently asked questions

Why does GA4 not show query parameters in my Landing Page report?

GA4 uses the Landing page dimension by default, which strips query strings. Switch to Landing page + query string in an Explore report, or build a Looker Studio view using that dimension.

Can I track UTM parameters in GA4 without any setup?

Yes. GA4 automatically parses utm_source, utm_medium, utm_campaign, utm_term, and utm_content into their own dimensions. You do not need custom dimensions for these. Check the Traffic acquisition report.

How long does it take for a custom dimension to show data?

Typically 24 to 48 hours after you register it in Admin. The dimension will not backfill historical data, so events fired before registration will not have that parameter available.

What is the difference between Landing page and Session default channel group?

Landing page tells you which URL the user entered on. Session default channel group tells you which traffic source drove them there (Organic Search, Paid Social, Direct, etc). You often want both dimensions in the same report.

Can I filter GA4 reports by a specific URL parameter value?

Yes. In Explore, add a filter on Page path + query string with condition contains and the parameter value, for example variant=b. Or filter directly on your custom dimension once it is registered.

Does GA4 support tracking hash fragments like #section?

No, not natively. GA4 captures the query string but ignores the hash. If you need to track hash-based routing (common in single-page apps), fire a manual page_view event when the hash changes and include the fragment as an event parameter.

Should I use GA4 or a dedicated A/B testing tool for variant tracking?

For quick tests on small traffic, GA4 with query strings works. For statistical rigor, traffic splitting, and automatic winner detection, use a dedicated tool. Read our take on A/B testing without wasting traffic to decide.


Once you have variant data flowing into GA4, the next step is fixing the pages that lose. PagePulse audits your live landing pages against 40+ conversion checks and flags exactly which elements are hurting your variant B, so you know what to change before the next test. Run a free audit at pagepulse.page.