The Scenario
You are an SEO analyst. 60 days of data, 12 countries, 80 landing pages. Your content director wants to know which landing pages are underperforming for organic search in specific countries — so the team can prioritize localization work for Q3.
You need a pivot table: landing pages as rows, countries as columns, organic sessions as the values. GA4 can produce a pivot report via its API, but the Explore interface does not export pivot-shaped output. It exports flat rows, which means you would have to reshape the data yourself.
The bad version of this analysis:
- Export organic sessions by landing page and country as a flat CSV from GA4 Explore
- Open the CSV in Sheets, identify the unique country values (12 of them)
- Manually create a pivot table structure with QUERY or pivot table tool
- Realize the landing page dimension includes query strings and you need to strip them first
- Clean the page paths, rebuild the pivot
- The pivot tool uses sums but some of your landing pages have duplicate rows because of how GA4 reports sub-pages
- You spend three hours on data reshaping and your content director gets the table on Thursday instead of Tuesday.
The fast version is one prompt.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent inside your Google Sheet that can run a GA4 pivot report and write the cross-tab directly into your sheet — no manual reshaping required.
Open the SheetXAI sidebar and type:
Run a GA4 pivot report with landing page as rows, country as the pivot dimension, and organic sessions as the metric for the last 60 days. Write the result as a cross-tab into my Google Sheet at A1 — landing pages as row headers, countries as column headers, session counts as cell values.
SheetXAI calls the GA4 Pivot API, structures the response as a cross-tab, and writes the output with landing page names in column A and one country per subsequent column. The row and column headers come from the GA4 data, not from a manual configuration.
What You Get
A cross-tab pivot table:
- Row 1 — country names as column headers (one per country with organic traffic in the period)
- Column A — landing page paths as row headers
- Cell values — organic session count for that landing page × country combination
- Zero values — where a page had no organic traffic from that country in the 60-day window
The pivot structure is ready for conditional formatting. Ask SheetXAI to highlight cells below a threshold — say, pages with fewer than 10 organic sessions from a specific country — and it adds the formatting after writing the data.
This is the geo-content gap view your content director asked for. Pages with strong US organic traffic and low Germany traffic are the localization candidates.
What If the Data Is Not Quite Ready
Organic search data in GA4 comes with quirks. SheetXAI handles them inline.
When landing page paths include query strings
GA4 sometimes logs /blog/post?ref=newsletter and /blog/post as separate rows. Your pivot ends up with dozens of near-duplicate page path rows.
Run the GA4 pivot report for landing page × country × organic sessions for the last 60 days. Before writing the cross-tab, strip query strings from page paths and consolidate duplicate rows by summing sessions. Then write the clean pivot at A1.
When you only want the top 20 landing pages by total organic sessions
The full pivot has 80 pages and most of them have negligible traffic. You want to focus on the pages that actually matter.
Run the GA4 pivot report for landing page × country × organic sessions for the last 60 days. Filter to the 20 landing pages with the highest total organic sessions across all countries. Write the cross-tab at A1 with those 20 pages as rows and the 12 country columns.
When you want to add a "Top Country" column
After the cross-tab, you want a column that names the country with the most organic sessions for each landing page.
Run the GA4 organic sessions pivot for landing page × country for the last 60 days and write the cross-tab at A1. Then add a column at the end of each row labeled Top Country that names the country with the highest session count for that landing page.
When you want the full gap analysis in one shot
You need the pivot, the top-country column, and a separate summary table listing the five landing pages with the biggest gap between their best country and their worst country — all before the Tuesday content meeting.
Run a GA4 pivot of organic sessions by landing page and country for the last 60 days. Write the cross-tab at A1. Add a Top Country column. Then, below the cross-tab starting at A85, write a five-row summary table showing the landing pages with the largest gap between their highest-performing country and their lowest-performing country (minimum 50 sessions in the top country). Label that table "Localization Gaps."
The pattern: instead of pulling flat data and reshaping it manually, you describe the pivot structure and the analysis you need in one prompt. Tuesday morning, not Thursday.
Try It
Get the 7-day free trial of SheetXAI and ask it to run a GA4 pivot report into any sheet you have open. The Google Analytics integration is included in every SheetXAI plan. See also how to batch-run five GA4 reports into separate tabs or the Google Analytics in Google Sheets overview.
