Content Performance Analyst
A content review that reads the accounts instead of asking for exports, and works from exports when nothing is connected. Every finding comes from a query this skill runs or a file the user gave, and every finding shows the numbers behind it.
Three ways to run it
| Mode | Ask for it with | What runs |
|---|---|---|
| Full content review (default) | "How did our content do last month?" | Areas 1 to 7, the cross-channel table and the ad candidates |
| Social media monthly report | "Build the monthly social media report for my boss / client" (also weekly or quarterly) | Area 1's tracking check, area 5's per-post pulls and the monthly social report |
| Content ROI report | "What does our content marketing return?", "Which articles bring customers?" | Area 1 and area 7, at full depth |
The user can ask for two at once (for example the full review plus the monthly social report); run the shared pulls once.
Without a connection
Every mode also runs from files. Ask for the ones the mode needs, read them as data, and apply the same rules:
- Full review: GA4 exports of pages (path, views, active users, engagement time, key events) and of sessions by landing page and channel for the period and the prior period; each network's post export (date, post, views or impressions, likes, comments, shares, clicks); the email platform's campaign export.
- Monthly social report: each network's monthly export or the numbers from its analytics screen (followers, views or impressions, engagements, clicks, posts) for this month, last month and the same month last year; a GA4 export of sessions by source for the same months; the goals, if any.
- Content ROI: a GA4 export of sessions, new vs returning, and key events by landing page; the CRM's closed-won deals (deal amount, close date, and the contact's first page seen or first URL); a cost sheet (URL, cost, format, topic, publish date).
Say at the top which numbers came from files and which from live queries. If a file is missing a column a check needs, mark that check unknown and name the column.
Before you start
With the InsightfulPipe MCP, GA4 is the core source. Each social network, Klaviyo, BigQuery and Google Sheets is optional; the report covers whatever is connected and lists the rest under unknowns.
- Call
query_contextswithrequest="accounts"forgoogle-analytics. Noteworkspace_id,brand_idandproperty_id; pass the property asproperties/<id>. Then runaccountsfor each content source the user has:facebook-pages(page_id),instagram-profile(account_id),linkedin-pages(org_id),youtube-analytics(channel_id),youtube-data(the samechannel_id, for video titles),pinterest-pages(account_id),tiktok-pages(account_id),x-organic(account_id) andklaviyo; for the ROI report alsobigquery(the GA4 export project) andgoogle-sheets(a cost or goals sheet). If a platform lists several accounts, ask which belong to this brand; match on the account name and handle, not on thebrand_id, because a brand's own TikTok or page can sit under a differentbrand_idthan its GA4 property. If none belongs to the brand, treat that network as not connected. Skip personal profiles unless the user asks for them. - Call
query_contextswithrequest="actions_details"for every action below that you will run, and follow the body shapes it returns. - Ask for these, and use the defaults if they don't know:
- Date range. Default: the last 30 complete days, compared with the same number of days before. When the user names a calendar month, or for the monthly social report, compare with the previous calendar month (months differ by up to 3 days; say so) and, for the monthly report, the same month a year before. Weekly reports run Monday to Sunday; quarterly reports run calendar quarters.
- Blog path. Default:
/blog/. Some sites use/articles/,/resources/or a subdomain. - Main conversion. Default: the key events from
list_key_events. - For the ROI report: cost per piece (a paste or a Google Sheet), the CRM's closed-won export, and whether the GA4 BigQuery export is on. Each is optional; the report says what it couldn't credit without them.
- For the monthly social report: goals per network, if they have them, and who reads it (a boss, a client) so the narrative fits.
State the dates, the GA4 property name, its time zone, and which sources were connected at the top of the report.
How to run the queries
Every body goes through query_data with the platform it names. Replace <WORKSPACE_ID>, <BRAND_ID>, <PROPERTY_ID>, <START>, <END> and the account ids. <BRAND_ID> is the brand_id the accounts call lists for the account in that body, so it can differ between networks. Rules the APIs enforce:
- GA4 filters are camelCase:
dimensionFilter,orderBys. A snake_case filter is silently ignored and returns every row, so check that a filtered report really is filtered. - GA4 leaves out days with no data. In a
datereport, count every missing date as 0 sessions. - GA4 rates are fractions (0.42 means 42%). Durations are seconds.
- Facebook
get_postsrejects nested fields such asreactions.summary(true), even though the helper lists them. Ask for flat fields only and take reactions and clicks fromget_post_insights. - YouTube
monthdimension needs month-aligned dates. Usedayand add the days up. - Pinterest analytics cover only the last 90 days. A window that starts earlier returns an error: mark Pinterest unknown for that window.
- Klaviyo reports need a timeframe of at most a year and return rates as fractions. The conversion metric defaults to "Placed Order"; say so.
- X reads are billed to the customer's own X developer account, per post returned. Ask for one month of posts at a time, in pages of up to 100, and fetch the next page only when the month isn't covered yet.
- BigQuery runs one SELECT statement over the connected project only (the GA4 export dataset must live in it; other projects, public ones included, are refused); no scripts. Run it with
dry_run: truefirst and show the bytes it would read; run it for real only after the user agrees to that size.
If a query fails, keep going. Mark that area unknown and say which query failed and why. Never fill a gap with a guess.
The seven areas
Score each area pass, warn, fail, unknown or not graded (no data of that kind in the period, for example no newsletter was sent). An area's result is its worst check. The thresholds are starting points; say so when the business makes one wrong.
1. Tracking health: can the site numbers be trusted?
{"platform": "google-analytics", "action": "get_property", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>"}
{"platform": "google-analytics", "action": "list_key_events", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>"}
{"platform": "google-analytics", "action": "list_data_streams", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>"}
{"platform": "google-analytics", "action": "get_enhanced_measurement_settings", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "data_stream_id": "<STREAM_ID>"}
Take <STREAM_ID> from the number at the end of the main web stream's name (the one whose defaultUri is the live site).
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["date"], "metrics": ["sessions", "screenPageViews", "keyEvents"], "start_date": "<START>", "end_date": "<END>", "orderBys": [{"dimension": {"dimensionName": "date"}}]}
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["eventName"], "metrics": ["eventCount", "keyEvents"], "start_date": "<START>", "end_date": "<END>", "orderBys": [{"metric": {"metricName": "eventCount"}, "desc": true}]}
| Check | Result |
|---|---|
| Gaps in the period | warn on any day with 0 sessions, or under 20% of the period's median day. Name the dates. |
| Tracking now | When the period ends before the last 30 complete days, run the date query again for those 30 days. fail when their median day is under 20% of the period's median day: traffic or tracking collapsed, and GA4 alone can't tell which. Ask the user to check the tag and the consent banner. If the last days of that window are back above 20% of the period's median, keep the fail, name those days and their sessions, and say tracking may have just recovered. |
| Key events | warn when key events are defined but none fired: conversions are not graded and content is ranked on engagement. fail when none are defined. |
| Trackers | Note whether outboundClicksEnabled, fileDownloadsEnabled and videoEngagementEnabled are on. Area 4 depends on them. |
2. Blog posts
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["pagePath", "pageTitle"], "metrics": ["screenPageViews", "activeUsers", "userEngagementDuration", "scrolledUsers", "keyEvents"], "start_date": "<START>", "end_date": "<END>", "dimensionFilter": {"filter": {"fieldName": "pagePath", "stringFilter": {"matchType": "BEGINS_WITH", "value": "/blog/"}}}, "orderBys": [{"metric": {"metricName": "screenPageViews"}, "desc": true}], "limit": 500}
Run it again for the prior period. Replace /blog/ with the user's blog path.
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["landingPage", "sessionDefaultChannelGroup"], "metrics": ["sessions", "engagedSessions", "keyEvents"], "start_date": "<START>", "end_date": "<END>", "dimensionFilter": {"filter": {"fieldName": "landingPage", "stringFilter": {"matchType": "BEGINS_WITH", "value": "/blog/"}}}, "orderBys": [{"metric": {"metricName": "sessions"}, "desc": true}], "limit": 1000}
- Merge by path. One post can show up under two titles (an old title, or a "not found" title from a time it was broken). Add the rows up per
pagePath, and flag any path that ever had a title containing "not found" or "404". - Sample size. Judge a post only with 10 or more views in the period. Count the rest as "too little traffic to judge".
- Engagement per view = userEngagementDuration ÷ screenPageViews, in seconds. Take the median across judged posts. Label each judged post: deep read at 2× the median or more, skimmed under half the median, steady otherwise.
- Scroll rate = scrolledUsers ÷ activeUsers. The enhanced measurement scroll event fires once, at 90% depth, so this is "read to the bottom".
- Concentration. warn when one post has more than 30% of all blog views, fail above 50%: one ranking change takes most of the blog's readers.
- Skimmed share. warn when skimmed posts hold more than 25% of judged views.
- Change. For posts with 10+ views in either period: new (0 views before), gone (0 views now), up or down by more than 30%, flat otherwise. Posts under 10 views in both periods get no change label.
- Where readers come from. Sessions that land on a blog post, by channel group, with the engaged share for each channel with 30+ sessions. State the blog's share of all site page views.
3. Site sections (content groups)
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["contentGroup"], "metrics": ["screenPageViews", "activeUsers", "userEngagementDuration", "keyEvents"], "start_date": "<START>", "end_date": "<END>"}
- If "(not set)" holds more than 90% of views, content groups aren't set up. warn, and group pages by their first path folder instead (
/blog/...→ blog,/→ home):
{"platform": "google-analytics", "action": "pages", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["pagePath"], "metrics": ["screenPageViews", "activeUsers", "userEngagementDuration", "keyEvents"], "start_date": "<START>", "end_date": "<END>", "limit": 1000}
Check meta.paging.total_available. If it is above 1000, page with offset before grouping, or say which share of views the groups cover.
- For the top 10 groups by views: pages, views, share of views, engagement per view and key events. warn when a group with 10% or more of views engages at under half the site's engagement per view.
- Content groups are set on the site (a
content_groupparameter in the tag), not in GA4 admin. Recommend it; it can't be switched on from here.
4. On-page actions: outbound clicks, downloads, video
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["linkDomain", "linkUrl", "pagePath"], "metrics": ["eventCount", "totalUsers"], "start_date": "<START>", "end_date": "<END>", "dimensionFilter": {"andGroup": {"expressions": [{"filter": {"fieldName": "eventName", "stringFilter": {"matchType": "EXACT", "value": "click"}}}, {"filter": {"fieldName": "outbound", "stringFilter": {"matchType": "EXACT", "value": "true"}}}]}}, "orderBys": [{"metric": {"metricName": "eventCount"}, "desc": true}], "limit": 500}
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["fileName", "fileExtension", "linkUrl", "pagePath"], "metrics": ["eventCount", "totalUsers"], "start_date": "<START>", "end_date": "<END>", "dimensionFilter": {"filter": {"fieldName": "eventName", "stringFilter": {"matchType": "EXACT", "value": "file_download"}}}, "orderBys": [{"metric": {"metricName": "eventCount"}, "desc": true}], "limit": 500}
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["eventName", "videoTitle", "videoProvider", "pagePath"], "metrics": ["eventCount", "totalUsers"], "start_date": "<START>", "end_date": "<END>", "dimensionFilter": {"filter": {"fieldName": "eventName", "inListFilter": {"values": ["video_start", "video_progress", "video_complete"]}}}, "limit": 500}
- Downloads hide inside outbound clicks. A file hosted on another domain fires both a
click(outbound) and afile_download. An outbound row whosepagePathandlinkUrlmatch a download row is a download: subtract it.file_downloadrows carry an emptylinkDomain, so match onlinkUrl. Report outbound clicks with downloads taken out, and say how many were removed. - Outbound: the top 10 destination domains and the top 10 pages that send visitors away. A page whose outbound clicks are 10% or more of its views (pages with 50+ views) is a page people leave from; say whether that's the point of the page (a docs link, a partner) or a leak (a competitor, an old tool).
- Downloads: the total, the top 10 files, and the 10 pages with the highest download rate among pages with 20+ views (downloads ÷ that page's views from area 3's pages query). Count the event totals, not the report rows. Flag a rate of 50% or more whose downloads are spread over 10 or more different files: that looks like bulk or automated downloading, so say so next to the rate and don't treat it as readers' interest.
- Video: starts, completes and completion rate (video_complete ÷ video_start) per video with 10+ starts. Video events only fire for embedded YouTube players with the JS API on. If tracking is on and there are no video rows, say "no tracked embedded video plays", not "nobody watched".
- Result: unknown for any tracker that is off (offer the fix below). Otherwise pass: this area reports, it doesn't grade.
5. Social posts, per network
Take the posts published in the period (YouTube: every video with views in the period, marking the ones published in it). Then work out, per post, views, engagements and engagement rate = engagements ÷ views. Judge a post only with 100+ views (YouTube 500+). Round rates only for display: take medians and the 1.5× test on the unrounded rates.
Facebook Pages
{"platform": "facebook-pages", "action": "get_page_info", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "page_id": "<PAGE_ID>", "fields": ["id", "name", "followers_count", "category", "website"]}
{"platform": "facebook-pages", "action": "get_posts", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "page_id": "<PAGE_ID>", "fields": ["id", "message", "created_time", "permalink_url", "status_type", "shares"], "since": "<START>", "until": "<END_PLUS_1>", "limit": 100}
<END_PLUS_1> is the day after <END>, so posts on the last day are included. Then, for each post:
{"platform": "facebook-pages", "action": "get_post_insights", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "page_id": "<PAGE_ID>", "post_id": "<POST_ID>", "metrics": ["post_media_view", "post_clicks", "post_reactions_by_type_total", "post_video_views"], "period": "lifetime"}
Views = post_media_view. Engagements = the reactions in post_reactions_by_type_total added up, plus post_clicks, plus shares.count from the post when present. For video posts, also give the 3-second view rate = post_video_views ÷ views. Comments aren't in these fields; say so.
{"platform": "instagram-profile", "action": "get_profile", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<IG_ACCOUNT_ID>", "fields": "user_id,username,name,account_type,followers_count,media_count"}
{"platform": "instagram-profile", "action": "get_media", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<IG_ACCOUNT_ID>", "fields": "id,caption,media_type,permalink,timestamp,comments_count,like_count", "limit": 100}
For each post in the period:
{"platform": "instagram-profile", "action": "get_media_insights", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<IG_ACCOUNT_ID>", "media_id": "<MEDIA_ID>", "metric": "views,reach,likes,comments,saved,shares,total_interactions"}
Views = views; engagements = total_interactions. Leave out posts whose caption says they are tests.
LinkedIn Pages (untested until connected: no LinkedIn organisation of the test brand was connected when this skill was built; bodies from the helper)
{"platform": "linkedin-pages", "action": "fetch_organization_posts", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "org_id": "<ORG_ID>", "count": 50}
{"platform": "linkedin-pages", "action": "fetch_share_statistics_per_post", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "org_id": "<ORG_ID>", "post_urns": ["<POST_URN>"]}
Send up to 20 URNs per call. Views = impressions; engagements = clicks + likes + comments + shares. If the call says the page needs reconnecting, or no organisation belongs to this brand, mark LinkedIn unknown and say which.
YouTube
{"platform": "youtube-analytics", "action": "channel", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "channel_id": "<CHANNEL_ID>", "start_date": "<START>", "end_date": "<END>", "metrics": ["views", "engagedViews", "estimatedMinutesWatched", "subscribersGained", "subscribersLost", "likes", "shares", "comments"], "dimensions": ["day"]}
{"platform": "youtube-analytics", "action": "video", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "channel_id": "<CHANNEL_ID>", "start_date": "<START>", "end_date": "<END>", "metrics": ["views", "engagedViews", "estimatedMinutesWatched", "averageViewDuration", "averageViewPercentage", "likes", "shares", "comments", "subscribersGained"], "dimensions": ["video"], "sort": "-views", "max_results": 200}
{"platform": "youtube-analytics", "action": "video", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "channel_id": "<CHANNEL_ID>", "start_date": "<START>", "end_date": "<END>", "metrics": ["views", "engagedViews", "estimatedMinutesWatched"], "dimensions": ["creatorContentType"]}
This is YouTube's top-videos report: at most 200 rows. Titles and publish dates (pass up to 50 video ids from the report per call, comma-separated):
{"platform": "youtube-data", "action": "get_videos", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "channel_id": "<CHANNEL_ID>", "part": "snippet,contentDetails", "id": "<VIDEO_IDS>", "max_results": 50}
Engagements = likes + comments + shares. Coverage. Add up the views of the listed videos and divide by the channel's views. Under 80%, say so and show the split by content type (Shorts or long-form): the top-videos report doesn't list every video that earned views, and it doesn't say why. Judge only the listed videos, and never assign the channel total to them.
{"platform": "pinterest-pages", "action": "get_user_account_analytics", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<PINTEREST_ACCOUNT_ID>", "start_date": "<START>", "end_date": "<END>"}
{"platform": "pinterest-pages", "action": "get_pins", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<PINTEREST_ACCOUNT_ID>"}
For each pin created in the period:
{"platform": "pinterest-pages", "action": "get_pin_analytics", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<PINTEREST_ACCOUNT_ID>", "pin_id": "<PIN_ID>", "start_date": "<START>", "end_date": "<END>", "metric_types": ["IMPRESSION", "SAVE", "PIN_CLICK", "OUTBOUND_CLICK"]}
Views = impressions; engagements = saves + pin clicks + outbound clicks. has_been_promoted on the pin says whether it already ran as an ad.
TikTok
{"platform": "tiktok-pages", "action": "list_videos", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<TIKTOK_ACCOUNT_ID>", "auto_paginate": false, "fields": ["id", "create_time", "share_url", "title", "video_description", "duration", "like_count", "comment_count", "share_count", "view_count"], "max_count": 20}
Views = view_count; engagements = likes + comments + shares. These are lifetime counts; say so. Page with cursor for more than 20 videos.
X (untested until connected: the test brand's X app needed reconnecting when this mode was built; body from the helper)
{"platform": "x-organic", "action": "get_user_posts", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<X_USER_ID>", "start_time": "<START>T00:00:00Z", "end_time": "<END_PLUS_1>T00:00:00Z", "exclude": "replies,retweets", "post.fields": "created_at,public_metrics", "max_results": 100}
Views = public_metrics.impression_count; engagements = likes + replies + reposts + quotes. Lifetime counts; say so. Each post returned is billed to the customer's X account. If X answers that the keys were rejected, mark X unknown and say the connection needs the current app keys.
Network checks
- Per network: posts in the period, total views, median views per post, median engagement rate of judged posts, and followers where the platform gives them.
- warn when a network's median post gets under 50 views: the posts reach almost nobody, so post-by-post comparisons are noise.
- not graded for a network with no posts in the period, unknown for one that is not connected or errors.
6. Email
{"platform": "klaviyo", "action": "get_campaigns", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "filter": "equals(messages.channel,'email')", "sort": "-created_at", "auto_paginate": true}
{"platform": "klaviyo", "action": "get_campaign_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "body": {"data": {"type": "campaign-values-report", "attributes": {"timeframe": {"start": "<START>T00:00:00Z", "end": "<END_PLUS_1>T00:00:00Z"}, "filter": "equals(send_channel,\"email\")", "statistics": ["recipients", "delivered", "opens_unique", "open_rate", "clicks_unique", "click_rate", "unsubscribe_rate", "spam_complaint_rate", "conversions", "conversion_value"]}}}}
{"platform": "klaviyo", "action": "get_flow_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "body": {"data": {"type": "flow-values-report", "attributes": {"timeframe": {"start": "<START>T00:00:00Z", "end": "<END_PLUS_1>T00:00:00Z"}, "filter": "equals(send_channel,\"email\")", "statistics": ["recipients", "delivered", "opens_unique", "open_rate", "clicks_unique", "click_rate", "unsubscribe_rate", "spam_complaint_rate", "conversions", "conversion_value"]}}}}
- Join the report rows to campaign names from
get_campaigns. Count campaigns with status "Sent" in the period; drafts don't count. - Rank on click rate, not open rate: Apple Mail privacy opens inflate open rates.
- warn when a campaign's click rate is under 1% or its unsubscribe rate is over 0.5%. fail when a spam complaint rate is over 0.1%.
- Cross-check with GA4: sessions in the Email channel group (from the query in the cross-channel table). Clicks with no Email sessions mean the links aren't UTM-tagged.
- not graded when nothing was sent in the period.
7. What content earns (content ROI)
Engagement says people read; this area says whether reading turned into leads and customers. It runs in the full review whenever key events fire, and alone as the content ROI report. not graded when no key event fired in the period and no CRM export was given.
Leads and first visits by article (GA4)
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["landingPage", "newVsReturning"], "metrics": ["sessions", "engagedSessions", "keyEvents", "totalRevenue"], "start_date": "<START>", "end_date": "<END>", "dimensionFilter": {"filter": {"fieldName": "landingPage", "stringFilter": {"matchType": "BEGINS_WITH", "value": "/blog/"}}}, "orderBys": [{"metric": {"metricName": "sessions"}, "desc": true}], "limit": 1000}
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["landingPage", "eventName"], "metrics": ["keyEvents"], "start_date": "<START>", "end_date": "<END>", "dimensionFilter": {"filter": {"fieldName": "landingPage", "stringFilter": {"matchType": "BEGINS_WITH", "value": "/blog/"}}}, "orderBys": [{"metric": {"metricName": "keyEvents"}, "desc": true}], "limit": 1000}
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["firstUserDefaultChannelGroup"], "metrics": ["totalUsers", "newUsers", "keyEvents"], "start_date": "<START>", "end_date": "<END>", "dimensionFilter": {"filter": {"fieldName": "landingPage", "stringFilter": {"matchType": "BEGINS_WITH", "value": "/blog/"}}}, "orderBys": [{"metric": {"metricName": "newUsers"}, "desc": true}]}
- Leads per article = key events in sessions that landed on it, split by key event name from the second query (drop rows with 0). The
newrows of the first query are first visits: people whose first session on the site started on that article. Say "landed on", never "caused". - Where first-time readers come from: the third query, by the channel that first brought each user.
- Revenue. Use
totalRevenueonly when the site sends purchase revenue to GA4. For lead-based businesses it is 0; use the CRM export.
Closed-won deals (CRM export, pasted or uploaded). Needs the deal amount, the close date and the contact's first page seen (HubSpot calls it "First page seen"; other CRMs hold a first URL or landing page field). Strip the domain, query string and trailing slash differences, then match the path to the articles. Count deals closed in the period. Deals whose first page isn't an article go under "other first pages", with their count and total.
Earlier touches (GA4 BigQuery export). GA4's reporting API has no assisted-conversion report, so "an article appeared earlier in the journey" needs the raw export. Check that a dataset named analytics_<PROPERTY_ID> exists:
{"platform": "bigquery", "action": "list_datasets", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>"}
Then run this (dry run first), with the key event names from list_key_events, a lookback start 90 days before <START>, and dates as YYYYMMDD in the table suffix:
{"platform": "bigquery", "action": "run_query", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "dry_run": true, "max_rows": 1000, "query": "WITH ev AS (SELECT user_pseudo_id, event_name, TIMESTAMP_MICROS(event_timestamp) AS ts, REGEXP_EXTRACT((SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'page_location'), r'^https?://[^/]+(/[^?#]*)') AS path FROM `analytics_<PROPERTY_ID>.events_*` WHERE _TABLE_SUFFIX BETWEEN '<LOOKBACK_START_YYYYMMDD>' AND '<END_YYYYMMDD>'), conv AS (SELECT user_pseudo_id, MIN(ts) AS conv_ts FROM ev WHERE event_name IN ('<KEY_EVENT_1>', '<KEY_EVENT_2>') AND ts >= TIMESTAMP('<START>') AND ts < TIMESTAMP('<END_PLUS_1>') GROUP BY user_pseudo_id), firsts AS (SELECT user_pseudo_id, ARRAY_AGG(path ORDER BY ts LIMIT 1)[OFFSET(0)] AS first_path FROM ev WHERE event_name = 'first_visit' GROUP BY user_pseudo_id), touches AS (SELECT DISTINCT e.user_pseudo_id, e.path FROM ev e JOIN conv c USING (user_pseudo_id) WHERE e.event_name = 'page_view' AND STARTS_WITH(e.path, '/blog/') AND e.ts < c.conv_ts AND e.ts >= TIMESTAMP_SUB(c.conv_ts, INTERVAL 90 DAY)) SELECT t.path, COUNT(DISTINCT t.user_pseudo_id) AS converters_who_read_it, COUNT(DISTINCT IF(f.first_path = t.path, t.user_pseudo_id, NULL)) AS converters_whose_first_page_it_was FROM touches t LEFT JOIN firsts f USING (user_pseudo_id) GROUP BY t.path ORDER BY converters_who_read_it DESC"}
Converters are counted once per article they read in the 90 days before converting. A first_visit older than the lookback isn't in the window, so the first-page column undercounts long journeys; say so. Without the export, earlier touches are unknown; recommend linking GA4 to BigQuery and say it only collects data from the day it is switched on.
Cost per piece (pasted, or a Google Sheet). URL, cost, format, topic, publish date. From a sheet, look at the columns first, then read the rows:
{"platform": "google-sheets", "action": "get_sheet_peak", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "spreadsheet_id": "<SPREADSHEET_ID>", "sheet_id": "<SHEET_ID>"}
{"platform": "google-sheets", "action": "query_sheet_data", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "spreadsheet_id": "<SPREADSHEET_ID>", "sheet_id": "<SHEET_ID>", "select": "<URL_COLUMN>,<COST_COLUMN>,<FORMAT_COLUMN>,<TOPIC_COLUMN>"}
<SHEET_ID> is the tab's id: the number after gid= in the sheet's URL (0 for the first tab). Column names are case-sensitive; take them from get_sheet_peak.
Rules
- Three kinds of credit, never added together: first landing (GA4: the session started on the article), first touch (CRM first page seen, or the BigQuery first-page column) and earlier touch (BigQuery: read before converting). One customer can count in all three. Show them side by side and say which one the money figures use: first touch from the CRM when given, else none.
- Volume before a verdict. Judge an article only with 100+ landing sessions in the period and either 5+ key events or 2+ closed-won deals. Everything else is "too early to call", with its numbers shown.
- Visitors vs buyers. Key-event rate = key events ÷ landing sessions. Take the median across judged articles. A traffic piece is in the top quarter of articles by landing sessions with a key-event rate under half that median: it brings visitors, not buyers. A buyer piece has a key-event rate at least 1.5× the median. Everything else is steady. Judge the rate only on judged articles.
- Cost and payback (only with costs): cost per lead = cost ÷ key events; payback = closed-won revenue credited by first touch ÷ cost, shown as a ratio (1.0 means it paid for itself). An article with leads but no closed deal yet is "leads, no revenue yet", not a loss: say how long deals usually take if the CRM export shows it (median days from the contact's create date to close).
- Formats and topics. Add costs, leads and revenue up per format and per topic, and divide the sums (never average the ratios). Rank only groups with 3+ pieces; list the rest as too small to rank.
- Never estimate revenue. If the user gives a value per lead, show it in its own labelled column ("at $X per lead, your figure"), never mixed with closed-won revenue.
| Check | Result |
|---|---|
| Leads tracked | fail when key events are defined but none fired on any blog landing session while the site recorded key events: the blog's readers never convert in the same session. Say so and look at earlier touches before calling the blog useless. |
| Concentration | warn when one article holds more than 50% of blog-credited leads or revenue. |
| Payback | warn when the judged articles with costs, together, return under 1.0 of their cost in the period. Say it can be early: articles keep earning after the period. |
Cross-channel table
{"platform": "google-analytics", "action": "get_report", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "property_id": "properties/<PROPERTY_ID>", "dimensions": ["sessionDefaultChannelGroup", "sessionSource", "sessionMedium"], "metrics": ["sessions", "engagedSessions", "keyEvents"], "start_date": "<START>", "end_date": "<END>", "dimensionFilter": {"filter": {"fieldName": "sessionDefaultChannelGroup", "inListFilter": {"values": ["Organic Social", "Paid Social", "Organic Video", "Paid Video", "Email"]}}}, "orderBys": [{"metric": {"metricName": "sessions"}, "desc": true}], "limit": 200}
One row per channel: blog, each social network, email. Columns: pieces in the period, views on the platform, engagements, sessions it sent to the site, and the engaged share of those sessions (only for 30+ sessions). Map sources to networks by domain: youtube.com and m.youtube.com → YouTube; facebook.com, m.facebook.com, l.facebook.com, lm.facebook.com → Facebook; instagram.com, l.instagram.com, ig → Instagram; linkedin.com, lnkd.in → LinkedIn; pinterest.com → Pinterest; tiktok.com → TikTok; x.com, twitter.com, t.co → X; the Email group → email. Put other social sources (forums, communities) in "other social". For the blog row, sessions are the sessions that landed on a blog post (area 2). Views on a platform and sessions on the site measure different things; never add them together.
Organic winners to promote as ads
A post is a candidate when all of these hold:
- 100+ views (YouTube: 500+), and 10+ engagements, so the rate isn't noise
- an engagement rate at least 1.5× its network's median for judged posts
- YouTube only: an average view percentage at or above the channel's median for judged videos
List up to 3 per network, best rate first, with the numbers. For each, say where it would run: a Facebook or Instagram post as a Meta ad using the existing post; a YouTube video in a Google Ads video or Demand Gen campaign; a LinkedIn post as sponsored content; a pin as a promoted pin; a TikTok video as a Spark Ad (the creator has to authorise it). Say whether it already ran as an ad when the platform tells you (has_been_promoted on pins); otherwise ask. If no post qualifies, say so and why. Blog posts labelled deep read with 10+ views are listed separately as articles worth sending paid or social traffic to.
This skill creates no ads. Hand the list to the ad skill for that platform if it is installed.
Social media monthly report
The report a social media manager sends a boss or client each month (or week, or quarter). It uses area 5's per-post pulls for the month and adds account totals, followers, the prior month and the same month last year.
Account totals and followers, per network. Run each for the month, the prior month and the same month last year (<END_PLUS_1> is the day after the month ends, <START_MINUS_1> the day before it starts).
Facebook takes two bodies. The totals for the month's own days:
{"platform": "facebook-pages", "action": "get_page_insights", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "page_id": "<PAGE_ID>", "metrics": ["page_media_view", "page_post_engagements", "page_video_views"], "period": "day", "since": "<START>", "until": "<END_PLUS_1>"}
And the follower count on its own, starting a day early so the first value is the closing count of the month before:
{"platform": "facebook-pages", "action": "get_page_insights", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "page_id": "<PAGE_ID>", "metrics": ["page_follows"], "period": "day", "since": "<START_MINUS_1>", "until": "<END_PLUS_1>"}
Keep them apart: moving since back a day on the first body would add a day before the month to its views and engagements.
Instagram refuses a since to until range longer than 30 days, so run the month in two halves and add them up: first since = <START> and until = <MID> (the 16th of the month), then since = <MID> and until = <END_PLUS_1>:
{"platform": "instagram-profile", "action": "get_account_insights", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<IG_ACCOUNT_ID>", "metric": "views,total_interactions,profile_links_taps,follows_and_unfollows", "period": "day", "metric_type": "total_value", "since": "<START>", "until": "<MID>"}
Views, interactions, link taps, follows and unfollows add up across the halves. Reach does not (an account reached in both halves would count twice), so the monthly report leaves it out. A weekly report needs one call; a quarterly one runs each month this way.
{"platform": "linkedin-pages", "action": "fetch_share_statistics_time_bound", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "org_id": "<ORG_ID>", "start_ms": "<START_MS>", "end_ms": "<END_PLUS_1_MS>", "granularity": "MONTH"}
{"platform": "linkedin-pages", "action": "fetch_follower_statistics_time_bound", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "org_id": "<ORG_ID>", "start_ms": "<START_MS>", "end_ms": "<END_PLUS_1_MS>", "granularity": "MONTH"}
{"platform": "linkedin-pages", "action": "fetch_total_follower_count", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "org_id": "<ORG_ID>"}
{"platform": "tiktok-pages", "action": "get_user_info", "workspace_id": "<WORKSPACE_ID>", "brand_id": "<BRAND_ID>", "account_id": "<TIKTOK_ACCOUNT_ID>", "fields": ["display_name", "username", "follower_count", "likes_count", "video_count"]}
``
…(truncated)