Claude automation recipe for analytics

Weekly UTM hygiene sweep

Each Monday this recipe pulls the past week's tagged GA4 traffic, tests every source, medium and campaign value against your written convention, and catches case slips, unknown mediums, internal tags and Unassigned sessions. Each problem lands in a Google Sheet with the campaign it probably belonged to and the corrected values. You decide whether the list goes to the team.

  • Schedule: Weekly on Monday morning
  • Mondays at 8 AM
  • Stops for your yes
  1. TriggerScheduleThe Monday timer starts a check of the last seven complete days
  2. ReadsGoogle Analytics MCP serverPulls session source, medium, campaign, channel group and landing page with sessions
  3. ReadsGoogle SheetsLoads the convention, active campaigns and open fix rows
  4. ClaudeClaudeFlags broken tags, matches each to a likely campaign and writes the fix
  5. Your yesSlackThe owner sees the top issues and approves sharing with the team
  6. Lands inGoogle Sheets and SlackFix rows written or updated, then the summary posted to the team channel

Where you say yes

The fixes sheet updates on every run, but the team post waits for the owner's yes in a Slack approval message. A no or no reply keeps the findings in the sheet and the channel untouched.

How it runs

  • Load the rulebook
    Allowed sources, allowed mediums, the campaign pattern, aliases and owned domains come from the convention tabs. An empty rule list ends the run, since checking tags against nothing would flag every row.
  • Pull only tagged traffic
    Seven complete days of GA4 rows come in with the five dimensions that matter. Direct, organic and plain referral rows are skipped because no person typed those values, while Unassigned rows are always kept.
  • Name what is broken
    Each combination is tested for case slips, unknown values, aliases, stray characters, campaign pattern breaks and tags on internal links. A row can break several rules and all of them are listed.
  • Guess the campaign with a reason
    Landing page, dates and campaign name are matched against the active campaigns tab, with a confidence and a short reason. When nothing fits, the row says to ask the channel owner rather than inventing a match.
  • Log, then ask before sharing
    New issues are appended and repeat offenders updated in place, with the place the bad link probably lives. The owner approves before the summary reaches the team channel.

What you need

  • A written UTM convention in a Google Sheet
  • An active campaigns tab with dates and landing pages
  • GA4 access at the Viewer role
  • Slack for the approval and the team post
  • A fixes tab with the columns in SKILL.md

Where automations like this break

  • Sweeps that treat organic and direct values as broken tags bury the real problems, so only traffic that came through tagged links is tested, plus Unassigned rows.
  • Weekly audits pile up duplicate rows for the same bad link, which this recipe avoids by updating an open row when the raw values match.
  • Campaign guesses with no evidence send people hunting for the wrong link, so every match comes from the active campaigns tab with a confidence and reason attached.

Three ways to wire it

The setup guide in the Operator Pack covers each path for weekly utm hygiene sweep, with the exact trigger, steps and approval node.

  • In n8n

    Node by node: the trigger, the data nodes, the Anthropic step with the skill as its instructions, the approval node and the output.

  • In Zapier

    Step by step: the trigger app and event, the data steps, the Claude step, the approval step and where the result lands.

  • In Claude with MCP

    Run it on demand in Claude or Claude Code with the listed MCP servers connected, before you schedule anything.

  • Before you turn it on

    The checklist: test on a copy, connect least-privilege accounts yourself, do a dry run and name who approves.

Free skills it builds on

Run these by hand first. Once you trust the output, the recipe runs the same method on a trigger.

MCP servers it reads through

Sources we checked

Questions about weekly utm hygiene sweep

If GA4 channel rules ignore case, why flag case mismatches?

Google says its default channel definitions are not case sensitive, so a session tagged with a capitalized medium can still land in the right channel. The sweep still flags it because the raw value is stored as typed, and when your source or campaign reports list both spellings as separate rows, the totals people compare week to week split apart. Fixing the link keeps future rows together.

Can it fix past data in GA4?

No. It reads reports and never changes GA4 settings or collected data. Correcting the tag at its source fixes future sessions, and the sheet records the date range affected so reports covering that period can be annotated or grouped by hand.

What counts as an Unassigned problem?

Unassigned is the label GA4 uses when a session's source and medium match none of the default channel rules. The sweep lists every such pair with its sessions and suggests the approved values that would map it to a real channel, usually by correcting the medium.

Need help becoming AI-forward?

We wire skills, MCP servers and your GTM tools into one system your team actually uses, with approvals on every write. Tell us where you are and we'll tell you the first thing we'd build.

Talk to us about AI