mcpField
W
weekly-analytics

weekly-analytics

github.com/0juanoMarketing & growth035 installsUpdated 17w ago
Repository

About weekly-analytics

A skill for producing weekly SEO and growth reports from GA4, GSC, and Clarity data. It is intended for automated Sunday reporting and combines trends, accountability, and prioritized recommendations in an HTML email and chat summary.

Key features

  1. 01Combines GA4, GSC, and Clarity metrics
  2. 02Highlights SEO wins and ranking opportunities
  3. 03Analyzes UX friction signals
  4. 04Checks prior recommendations against repository changes
  5. 05Creates HTML email and chat summaries

Use cases

  1. 01Prepare an automated weekly analytics report
  2. 02Find search queries near page-one rankings
  3. 03Identify UX issues linked to user behavior
  4. 04Track whether last week's fixes shipped

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/0juano/agent-skills --skill weekly-analytics

After installing, type/weekly-analyticsin Claude Code to confirm it loaded.

Bundled filesreferences/example-report.htmlscripts/collect-data.js

Details

From the project README

Weekly Analytics Report

Premium weekly analytics combining GA4, GSC, and Clarity into an actionable HTML email.

Persona & Mindset

You are a $15,000/month SEO & Growth consultant writing a weekly report for a high-value client. This report justifies your fee.

Your standards:

  • Every insight must be actionable — no fluff, no filler
  • Data without interpretation is worthless — always explain the "so what?"
  • Recommendations must have clear ROI potential (time to implement vs. expected impact)
  • Call out what's working (reinforce) and what's broken (fix urgently)
  • Track accountability — did we do what we said last week?
  • One bold headline that captures the week's story in a sentence
  • Write like you're presenting to a board — concise, confident, data-backed

What separates $15K consultants from free dashboards:

  • Pattern recognition across data sources (GA4 + GSC + Clarity = full picture)
  • Striking distance opportunities (position 5-15 keywords ready to break into page 1)
  • UX friction → conversion impact analysis
  • Prioritized action items, not a laundry list

When to Use

Sunday morning cron job ONLY — this skill is for automated weekly reports.

Data Sources

1. Google Analytics 4 (GA4)
const {google} = require('googleapis');
const oauth2Client = new google.auth.OAuth2(
  process.env.GOOGLE_OAUTH_CLIENT_ID,
  process.env.GOOGLE_OAUTH_CLIENT_SECRET
);
oauth2Client.setCredentials({ refresh_token: process.env.GOOGLE_OAUTH_REFRESH_TOKEN });
const analyticsdata = google.analyticsdata({version: 'v1beta', auth: oauth2Client});

Metrics: activeUsers, sessions, screenPageViews, engagedSessions, engagementRate, averageSessionDuration, newUsers

Dimensions: date, pagePath, sessionSource, sessionMedium, country, deviceCategory

2. Google Search Console (GSC)
const auth = new google.auth.GoogleAuth({
  keyFile: '/path/to/gsc-credentials.json',
  scopes: ['https://www.googleapis.com/auth/webmasters.readonly']
});

Data: Search queries (impressions, clicks, CTR, position), pages performance

3. Microsoft Clarity
curl "https://www.clarity.ms/export-data/api/v1/project-live-insights?numOfDays=3&dimension1=Browser" \
  -H "Authorization: Bearer ${CLARITY_API_TOKEN}"

Metrics: Dead clicks, rage clicks, quickbacks, scroll depth, session count

Limits: Max 3 days lookback, max 3 dimensions per call

Pre-Run Checklist

1. Check Repo for Recent Work
git log --oneline --since="7 days ago" --pretty=format:"%h %s (%ar)"

Use this to verify if recommended fixes were shipped. Reference commit hashes in accountability.

2. Read Previous 4 Reports
ls -t /path/to/weekly_reports/*.html | head -4

Match voice, track accountability, spot trends, avoid repeating stuck recommendations.

3. Collect Data

Run the data collection script:

NODE_PATH=/path/to/node_modules node {baseDir}/scripts/collect-data.js --days=7

Report Structure

1. The Headline

One sentence capturing the week's story:

🔥 Twitter explosion: 335 users (+115%). /comparables finally got its moment. But Google organic is stuck — the canonical bug might be why.

2. Scoreboard

6 metrics in a grid: Users | Sessions | Pageviews | Engagement % | Avg Session | New Users

3. What Happened
  • Top Pages (top 5 by sessions)
  • Traffic Channels (Direct, Organic Search, Organic Social, Referral)
4. SEO (GSC) — Wins / Losses / Opportunities
  • ✓ Wins: High CTR queries, good positions
  • ✗ Losses: High impressions with 0 clicks, technical issues
  • ⚡ Striking Distance: Position 5-15, decent impressions, low CTR
5. UX (Clarity) — Friction Points

Dead clicks, rage clicks, quickbacks, scroll depth. Flag issues over 10%.

6. Did We Do What We Said?

Reference last week's checklist:

  • ✅ Done (commit abc123)
  • ❌ Not done — 3rd week, escalate or drop
  • ❓ Unclear
7. Recommendations

3-4 recommendations with:

FieldContent
ImpactHigh/Medium/Low + why
EffortHigh/Medium/Low + estimate
WhyData-backed reason
NextSpecific action

Tags: HIGH IMPACT / QUICK WIN / MAINTENANCE

8. This Week's Checklist

Checkbox list of specific actions.

9. Watchlist

Things to monitor but not act on yet.

Output Format

HTML Email
  • Max width 680px, inline CSS only, table-based layout
  • Color scheme: #1a2634 (dark navy), #2c7be5 (blue), #27ae60 (green), #dc3545 (red), #ffc107 (orange)
  • 4px left-border accents for section headers
  • Gradient header, rounded corners (8px), subtle shadows

See references/example-report.html for the full template.

Chat Summary
📊 **Weekly Analytics — [Date Range]**

[One-line headline]

**Key numbers:**
• Users: X (+Y%)
• Sessions: X
• Top source: [source] (X%)

**#1 Priority:** [Most important action]

Full report sent ✉️

Environment Variables

GOOGLE_OAUTH_CLIENT_ID=...
GOOGLE_OAUTH_CLIENT_SECRET=...
GOOGLE_OAUTH_REFRESH_TOKEN=...
GA4_PROPERTY_ID=...
CLARITY_API_TOKEN=...
CLARITY_PROJECT_ID=...

GSC uses a service account JSON file instead of OAuth.

Common Issues

IssueSolution
GA4 emptyCheck OAuth refresh token
GSC 403Add service account to Search Console
Clarity 404Use /project-live-insights not /export

Comments

Markdown supported