Quick overview
This workflow runs every Monday at 7am to pull SEO rankings from SEMrush, traffic metrics from Google Analytics 4, and HTML from a competitor page, then uses an OpenAI chat model to write a short weekly intelligence summary and delivers it via Gmail and Slack, with Slack alerts on failures.
How it works
- Runs every Monday at 7am on a scheduled trigger.
- Requests domain organic ranking data from the SEMrush API, pulls a 7-day landing page report from the Google Analytics Data API (GA4), and downloads raw HTML from a specified competitor URL.
- Combines the SEMrush, GA4, and competitor-page responses into a single dataset for analysis.
- Hashes the competitor HTML, compares it to the previous run’s stored hash, and flags whether the competitor page changed.
- Sends the combined SEO data and change flag to an AI agent using the OpenAI chat model (gpt-5-mini) to generate a 4–5 sentence summary with one key action item.
- Sends the summary as an HTML email via Gmail and posts the same text to a Slack channel.
- If any step fails, posts an error alert with the execution message to an ops Slack channel.
Setup
- Add your SEMrush API key (or required authentication method) to the SEMrush HTTP request and replace
REPLACE_WITH_DOMAIN with the domain you want to track.
- Create a Google Cloud OAuth credential with access to the Google Analytics Data API, connect it in the GA4 HTTP request, and replace
YOUR_GA4_PROPERTY_ID in the request URL.
- Replace
REPLACE_WITH_COMPETITOR_URL with the competitor page you want to monitor for HTML changes.
- Add your OpenAI credential and ensure the workflow can access the
gpt-5-mini model.
- Connect your Gmail account and update the recipient address in the email step.
- Connect your Slack account and set the target channel IDs for the weekly report and the ops alert message.