Skip to content

channel-metrics-sync

Once a week, reads which publishing channels the vault has configured, reads each one, and writes the metrics of each post it finds for the last 7 days onto one marketing-content note per post (the engagement: mapping the data model defines). YouTube and LinkedIn posts without a note get a new one; Substack posts are measured only through their existing vault note. A run report lists the channels, the records, the ad campaigns in the window, any GA4 sessions joined by UTM tag, every configured channel that could not be read (marked new or ongoing), the files written and how to undo them. A Base view shows the records. It records numbers; it does not judge them.

  • Area: Marketing
  • Category: marketing analytics
  • Level: advanced
  • Input: conversation
  • Output: document
  • Setup: api-key
  • Roles: Head of Marketing, Content Manager

Records the last 7 days of published YouTube uploads (Data API), Substack posts (via their vault notes) and LinkedIn posts (from the hand-filled performance log) as one…

How you ask

  • “Run the weekly channel metrics sync for the company”
  • “Record this week's LinkedIn, Substack and YouTube post numbers”
  • “Which of our channels did the metrics sync fail to read?”

Inputs

  • scope — company, or a client-id under {company.clients}/
  • channel-registry — social-channel and ad-account notes; their status decides which channels are configured. Missing or with no configured channel, the run stops with exit 2.
  • performance-log — LinkedIn performance log kept by hand by social-content; the only LinkedIn source.
  • today — Last day of the window (default today); the window is the 7 days ending on it.
  • substack-dashboard-csv — The owner's Substack Stats export, for opens, clicks and views.
  • ga4-report — JSON rows the agent read with the analytics-mcp run_report tool (date, campaign, ad content, source, sessions, keyEvents).
  • channel-registry — social-channel and ad-account notes; their status decides which channels are configured.
  • backup-dir — Folder outside the vault; each write run copies the notes it updates into a new run-* subfolder there.
  • substack-dashboard-csv — The same Stats export passed to the preview, so opens and clicks are written.
  • ga4-report — The same GA4 rows passed to the preview.

Outputs

  • Copied from assets/ on the first write run; an existing file is never overwritten.
  • New marketing-content note for a YouTube or LinkedIn post that had none; matched notes are updated in place, engagement mapping only.
  • Run report (type report, report_type channel-metrics-sync); a second run on the same day adds -{HHMMSS}.
  • The run report as Markdown, or the run summary as JSON with --json; nothing is written.
  • {scope.marketing.channel-work}/{platform}/{published_date}_{slug}.md
  • {scope.marketing.insights}/channel-metrics-sync-{YYYY-MM-DD}.md
  • {vault.bases}/Channel-Metrics.base