agentleFS
surendranbsurendranb/google-analytics-mcp/skills/date-ranges/SKILL.md

date-ranges

Skill244 starsChanged 43 days agoMITView on GitHub

How to specify date ranges in `get_ga4_data` and how to structure period-over-period comparisons.

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not use date_range_end: "today" when comparing to a prior complete period

    line 80

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Date Ranges

How to specify date ranges in get_ga4_data and how to structure period-over-period comparisons.

Valid formats

date_range_start / date_range_end accept:
  "YYYY-MM-DD"   — absolute date, e.g. "2024-01-15"
  "today"        — current day (partial — use carefully)
  "yesterday"    — last complete day
  "NdaysAgo"     — N days back from today, e.g. "7daysAgo", "30daysAgo", "90daysAgo"

NdaysAgo excludes today. 7daysAgo to yesterday = last 7 complete days.

Common windows

Windowstartend
Last 7 days7daysAgoyesterday
Last 28 days28daysAgoyesterday
Last 90 days90daysAgoyesterday
This monthYYYY-MM-01today
Last monthYYYY-MM-01 (prior)YYYY-MM-last-day (prior)
Year to dateYYYY-01-01yesterday

Period-over-period comparison

The GA4 Data API does not support multi-period in a single call. Run two separate get_ga4_data calls, then compare the results.

Example: week-over-week

Call 1 — this week:

date_range_start: "7daysAgo"
date_range_end:   "yesterday"

Call 2 — last week:

date_range_start: "14daysAgo"
date_range_end:   "8daysAgo"

Example: year-over-year for July

Call 1 — this year:

date_range_start: "2025-07-01"
date_range_end:   "2025-07-31"

Call 2 — last year:

date_range_start: "2024-07-01"
date_range_end:   "2024-07-31"

Then compute the delta: (current - prior) / prior * 100 for each metric.

Partial-day reads

today includes only the hours elapsed so far. Comparing today to yesterday is misleading — yesterday is a full day, today is partial.

For intra-day analysis, use today for both start and end and note the IST hours covered in your interpretation.

Common mistakes

  • "last7days" is NOT valid — use "7daysAgo"
  • "last-week" is NOT valid — use absolute dates or NdaysAgo
  • Do not use date_range_end: "today" when comparing to a prior complete period
  • "0daysAgo" = today (same as "today")

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.