Course overviewGoogle Search · Build a search performance report
Find frequently searched queries
Normalize query variants, apply a volume minimum, and rank with deterministic ties.
Step 1 of 3 · Learn
Combine formatting variants, not search events
Trim query edges, lowercase text, and collapse whitespace before grouping. Each search still counts as an event. Exclude missing queries and strings that become empty after cleaning; do not deduplicate the search rows.
index
query
0
Tea Shops
1
tea shops
2
COFFEE
↓
index
normalized_query
searches
0
coffee
1
1
tea shops
2
Two formatting variants contribute two searches to the same normalized query.
Apply a minimum before selecting the top rows
Aggregate first, keep query groups with at least the required count, then sort count descending and normalized query ascending. The second key makes tied counts deterministic. Take at most the requested number after filtering.
index
query
searches
0
alpha
3
1
beta
1
2
gamma
3
↓
index
query
searches
0
alpha
3
2
gamma
3
The count minimum is inclusive; alphabetical order breaks the tie.
Keep the rate at query level
For each normalized query, zero_result_rate is zero-result searches divided by all searches for that query. A Boolean mean computes this proportion. Do not filter to zero-result events before calculating the denominator.
▷ Your turn
Normalize searches.query by trimming, lowercasing, and collapsing whitespace to one space. Exclude missing and empty normalized queries. Return normalized_query and searches for every remaining query group, counting all search events and sorting normalized_query ascending. Save the DataFrame as result.