R Bloggers iconR BloggersSep 3, 2026 ~8 min source read

R For SEO Part 10: Build an automated SEO report with Google Sheets and OpenRouter

The final instalment of Ben Johnston’s R for SEO series brings previous lessons together: pull Google Analytics and Search Console data, add SEMRush visibility, generate commentary with OpenRouter, and export everything to Google Sheets. Includes a practical note on authenticating searchConsoleR after its removal from CRAN.

R For SEO Part 10: SEO Reporting With Google Sheets & OpenRouter

Share this story

Send the public story page.

Useful takeaways from this story.

Combine GA, Search Console and SEMRush data in R, append recent windows on each refresh, and push results to Google Sheets for reporting.

Use OpenRouter to generate automated commentary that is sent to the same Google Sheet alongside raw metrics.

Organise code into functions and use Git branching for each feature (data pulls, auth, commentary, sheet upload) to keep the project maintainable.

This final part of the R for SEO series ties together earlier topics into a repeatable SEO reporting workflow built in R. The goal is a report that combines a year of Google Analytics data (updated with the last 30 days on refresh), Search Console metrics (clicks, impressions, average position, CTR), SEMRush visibility for a target domain, and automated narrative commentary. All outputs are written to Google Sheets so a Data Studio template or other consumer can visualise them.

  • Google Analytics: pull the previous 12 months and append the most recent 30 days on each refresh. This keeps a rolling dataset without re-fetching everything every run.
  • Google Search Console: collect clicks, impressions, average position and CTR for the same windows as Analytics.
  • SEMRush: fetch visibility numbers for the monitored domain using the SEMRush API.
  • Commentary: use OpenRouter to convert metric changes into plain-language commentary and write that text back to the sheet alongside metrics.
  • Output: upload all datasets and the generated commentary into a single Google Sheet ready for downstream reporting.

Practical authentication note for Search Console and Analytics

  • install the remotes package and use install_github("MarkEdmondson1234/searchConsoleR").

If your workflow also pulls Google Analytics via the same auth flow, these extra steps will affect Analytics authentication too, so apply the updated process to both services.

Google Sheets is the destination for both raw data and the generated narrative. It's quick to connect to reporting tools such as Data Studio and makes the final report accessible to non-technical stakeholders. Writing both metrics and commentary into the same sheet reduces the friction of building a presentation layer.

Where this guide fits with the series

The series previously covered: R basics, pulling GA and GSC data (earlier approach), ggplot2 visualisation, writing functions, replicating Excel formulas, using APIs (SERPAPI, SE Ranking, SEMRush), loops and apply methods, and web scraping. This final piece demonstrates how to combine those skills into an automated, reproducible report that finishes the sequence of practical tutorials.

Follow Ben's code structure: install required packages (including the remotes-installed searchConsoleR), create concise functions for each data source, build and test the OpenRouter commentary step, and wire up Google Sheets export. Use Git branches for each major change so you can revert or iterate safely.

More context around this story.

9 Search Console Reports Worth Checking Weekly
Editorialge iconEditorialgeAug 31, 2026

9 Search Console Reports Worth Checking Weekly

Search Console reports are the most direct way to track organic traffic shifts, indexation failures, and technical site health. Rather than opening your performance graph without a plan, a structured weekly review reveals exactly what changed, which URLs were impacted, and who needs to fix it. To prioritize your time,

Onrec iconOnrecSep 19, 2026

8 SEO Analysis Tools a 4-Step Pipeline Actually Needs (2026)

Stuart Gentle Publisher at Onrec 19 Sep 2026 | 8 SEO Analysis Tools a 4-Step Pipeline Actually Needs (2026) Joining a crawl to raw access logs needs a dedicated log-ingesting crawler. The list below is ordered by pipeline step. SE Ranking is the strongest of these eight SEO analysis tools for a team running the pipelin

GEO своими руками: собираем трекинг видимости бренда в ИИ‑ответах на n8n [+ воркфлоу]
Habr iconHabrSep 6, 2026

GEO своими руками: собираем трекинг видимости бренда в ИИ‑ответах на n8n [+ воркфлоу]

Можно быть хоть топ-1 в органической выдаче по всем коммерческим запросам, но ни разу не попасть в ИИ ответ от Google или Яндекс. Я собрал собственный автоматический мониторинг видимости бренда на n8n (43 ноды): раз в месяц опрашиваем Яндекс, GPT, Gemini и Qwen, отделяем цитирование из выдачи от ответов модели по памят

8 GA4 Reports Content Teams Actually Need
Editorialge iconEditorialgeSep 27, 2026

8 GA4 Reports Content Teams Actually Need

GA4 has dozens of reports, and most of them were built for marketers and ad buyers, not editors. After almost 10 years in SEO and content writing, including my time as acting editor at Editorialge, I have boiled it down to a short list. These are the GA4 reports; content teams need to decide what […] The post 8 GA4 Rep

Loading more related stories...

Keep reading in the app

Open the app view to save this story, compare related coverage, and continue from the same source.

Open in app