Pandas · Create the weekly overview
Google Search Analytics
Course overviewGoogle Search · Build a search performance report

Create the weekly overview

Combine weekly search volume, clicked searches, CTR, changes, and CSV export.

Step 1 of 3 · Learn

Assign activity to the search week

Deduplicate clicked search IDs and attach markers to searches before weekly grouping. Use searched_at, not clicked_at, to assign the week. Any matching click in the provided clicks table marks its search as clicked, even if the click occurs in a later week.

indextimeclicked
02026-07-06T08:00:00Z1
12026-07-12T23:00:00Z0
22026-07-13T00:00:00Z1
indexweek_startsearchesclicked_searches
02026-07-06 00:00:00+00:0021
12026-07-13 00:00:00+00:0011
Assign each search to its search-time week, with its click marker already attached.

Retain the complete weekly calendar

Report the eight Monday-start UTC weeks beginning July 6 through August 24, 2026. Keep weeks with no searches as zero counts. Their CTR is missing because the denominator is zero; the first absolute search change is missing because no earlier report week is available.

indexsearchesclicked_searches
042
100
263
indexsearchesclicked_searchessearch_ctrsearch_change
0420.5NA
100NA-4
2630.56
A zero-search week has no defined CTR, but its absolute volume change is valid.

Export the report with explicit labels

Use .to_csv(index=False, date_format="%Y-%m-%d") for a CSV string with UTC week-start dates such as 2026-07-06. This omits the row index and leaves missing numeric cells empty. Keep the full precision of rates; the CSV date labels refer to UTC Mondays.

▷ Your turn

For the eight Monday-start UTC weeks from July 6 through August 30, 2026, return week_start, searches, clicked_searches, and search_ctr. Label weeks July 6 through August 24, ascending. Count each searched_at event in its own week; a matching click anywhere in the supplied clicks table marks that search once. Keep zero-count weeks with missing CTR. Exclude missing timestamps and searches outside [July 6, August 31). Keep UTC timestamps and unrounded rates. Save the DataFrame as result.

LANGUAGEPython · Pandas

Loading Python and Pandas…

Run the code to see DataFrame results here.