Sub topic 2
Known Gaps and Discrepancies in Search Data
Assume you know basic search ranking concepts, can use Search Console and an analytics tool such as GA4, and can read simple Python or SQL. Search data is observational: each tool measures a different stage of the visitor journey.
Known gaps and discrepancies
Search Console reports search results activity. GA4 reports visits after a user reaches your site. A Search Console click therefore will not always become an analytics session.
Common differences include:
- Search Console may delay or group data.
- Low-volume queries can be anonymized and omitted.
- Search Console has a limited retention period.
- Analytics can miss visits because of consent settings, ad blockers, or tracking errors.
- Rank trackers use selected locations, devices, and times. Search Console aggregates actual impressions across users.
- Search results change by location, device, personalization, and features such as maps or answer boxes.
Designing a daily table
Store data at a known grain. A useful grain is one row per date, query, page, country, and device. Keep the raw measures so you can aggregate them later.
| Column | Meaning |
|---|---|
| `date` | Search date |
| `query`, `page` | Search term and landing page |
| `clicks`, `impressions` | Search interactions and visibility |
| `position` | Search Console's average position for that row |
import pandas as pd
df = pd.DataFrame([
["2026-01-05", "blue shoes", "/shoes", 8, 200, 4.0, "nonbrand", "mobile"],
["2026-01-05", "blue shoes", "/shoes", 4, 100, 8.0, "nonbrand", "desktop"],
], columns=["date", "query", "page", "clicks", "impressions",
"position", "segment", "device"])
df["date"] = pd.to_datetime(df["date"])
df["position_x_impressions"] = df["position"] * df["impressions"]
summary = df.groupby(["segment", "device"], as_index=False).agg(
clicks=("clicks", "sum"),
impressions=("impressions", "sum"),
position_x_impressions=("position_x_impressions", "sum"),
)
summary["ctr"] = summary["clicks"] / summary["impressions"]
summary["avg_position"] = (
summary["position_x_impressions"] / summary["impressions"]
)
print(summary)Averaging position correctly
Average position is already an average for each source row. Do not average those values equally when rows have different impression counts. Use:
\[ \text{weighted position} = \frac{\sum(\text{position} \times \text{impressions})} {\sum(\text{impressions})} \]
CTR is also a ratio. Calculate it from total clicks divided by total impressions, rather than averaging row-level CTR values.
Segmenting and joining traffic
Add dimensions that answer a question: brand versus non-brand, page type, device, country, or query intent. Segments make a total change diagnosable. For example, a mobile-only decline suggests a different investigation from a decline limited to one page group.
Join Search Console data to analytics by date and landing page where possible. Compare Search Console clicks with GA4 organic sessions. They should show related trends, not identical totals.
Exercise
Why should two position rows with 100 and 10 impressions not receive equal weight in a combined average?
Show answer
The row with 100 impressions represents more observed search visibility, so position should be weighted by impressions.