Quick Overview
This workflow runs every Monday at 8 AM, pulls weekly performance data from Google Search Console for a chosen site, builds an HTML report comparing two 7-day periods, and emails the report via Gmail, with a separate alert email sent if any Search Console request fails.
How it works
- Runs on a schedule every Monday at 8 AM.
- Calculates two 7-day date ranges (current and previous) ending three days ago and stores the target Google Search Console site URL.
- Calls the Google Search Console Search Analytics API to fetch total clicks, impressions, CTR, and average position for both date ranges.
- Fetches the top queries and top pages for the current period (top 10) and also pulls larger query/page datasets for the previous period to enable comparisons.
- Aggregates the results and generates a formatted HTML email with KPI cards and tables showing week-over-week changes.
- Sends the report email via Gmail using a generated subject line based on clicks and the reporting period.
- Sends a Gmail error alert to the configured recipient if any Google Search Console API request returns an error.
Setup
- Add Google API credentials with access to the Google Search Console property you want to report on.
- Add a Gmail OAuth2 credential for sending both the report email and the error alert email.
- Update the site URL in the date-range configuration step to match your Google Search Console property.
- Set the recipient email address(es) for the report and the failure alert in the Gmail send steps.
- (Optional) Adjust the schedule time and the date-range offsets if you want a different send time or reporting window.