# Powered by Claude + GoMarble MCP
# ─────────────────────────────────────────
## MY ACCOUNT IDs
## Fill in the accounts you want. Leave others empty.
META_ADS_ACCOUNT_ID = "" # e.g. act_690401620213355
GOOGLE_ADS_CUSTOMER_ID = "" # e.g. 1646309870 (10 digits, no dashes)
TIKTOK_ADVERTISER_ID = "" # e.g. 7418147470729068561
LINKEDIN_ACCOUNT_ID = "" # e.g. 516414356
SHOPIFY_ACCOUNT_ID = "" # e.g. lyfefuel-main.myshopify.com
DATE_RANGE = "last_30d" # Options: last_7d | last_14d | last_30d | last_90d | this_month | last_month
---
## INSTRUCTIONS FOR CLAUDE
Using the GoMarble MCP tools, fetch performance data only from platforms that have a non-empty account ID above. Skip any platform whose ID is empty. Build a consolidated HTML report using only the data you successfully retrieve. A report with just one platform is perfectly valid — do not wait for all platforms.
---
### PLATFORM DATA FETCHING
For each platform below, if the ID is empty, skip that section entirely and move on.
---
#### META ADS (skip if META_ADS_ACCOUNT_ID is empty)
Call facebook_get_adaccount_insights with:
- act_id: META_ADS_ACCOUNT_ID
- fields: ["spend", "impressions", "clicks", "ctr", "cpm", "cpc", "actions", "action_values", "purchase_roas"]
- level: "account"
- date_preset: DATE_RANGE
- filtering: [{"field": "impressions", "operator": "GREATER_THAN", "value": 0}]
Extract: spend, impressions, clicks, CTR, CPM, CPC.
For conversions: check actions array for action_type = "omni_purchase" first; fall back to "purchase". For lead gen accounts: use action_type = "lead". NEVER sum multiple purchase action types together.
---
#### GOOGLE ADS (skip if GOOGLE_ADS_CUSTOMER_ID is empty)
Call google_ads_run_gaql with customer_id = GOOGLE_ADS_CUSTOMER_ID.
Query to run:
```
SELECT campaign.name, metrics.cost_micros, metrics.impressions, metrics.clicks, metrics.ctr, metrics.conversions, metrics.conversions_value, metrics.average_cpc FROM campaign WHERE segments.date DURING LAST_30_DAYS AND campaign.status = 'ENABLED' ORDER BY metrics.cost_micros DESC LIMIT 10
```
Important: cost_micros ÷ 1,000,000 = actual spend. average_cpc is already in account currency — do NOT divide it. Confirm account currency via google_ads_get_currency before displaying any monetary values. Calculate ROAS = conversions_value / spend. Calculate CPA = spend / conversions.
---
#### TIKTOK ADS (skip if TIKTOK_ADVERTISER_ID is empty)
Call tiktok_get_basic_report_enhanced with:
- advertiser_id: TIKTOK_ADVERTISER_ID
- data_level: "AUCTION_ADVERTISER"
- dimensions: ["advertiser_id"]
- metrics: ["spend", "impressions", "clicks", "cpc", "cpm", "ctr", "conversion", "cost_per_conversion"]
- start_date and end_date derived from DATE_RANGE (calculate relative to today)
---
#### LINKEDIN ADS (skip if LINKEDIN_ACCOUNT_ID is empty)
Call linkedin_get_ad_analytics with:
- finder_type: "analytics"
- pivots: ["ACCOUNT"]
- account_id: LINKEDIN_ACCOUNT_ID
- date_range_start / date_range_end derived from DATE_RANGE
- time_granularity: "ALL"
- fields: ["impressions", "clicks", "costInLocalCurrency", "totalEngagements", "externalWebsiteConversions", "oneClickLeads"]
If the call fails with a token or auth error, log it as a data gap and continue.
---
#### SHOPIFY (skip if SHOPIFY_ACCOUNT_ID is empty)
Call shopify_run_analytics_query with:
- account_id: SHOPIFY_ACCOUNT_ID
- dataset: "sales"
- metrics: ["gross_sales", "discounts", "net_sales", "total_sales", "orders", "average_order_value", "returning_customer_rate"]
- start_date / end_date derived from DATE_RANGE
- with_totals: true
---
### BUILDING THE REPORT
Once all available platform data is collected, call generateHtmlReport. Only include sections for platforms where data was successfully retrieved. Adapt the report dynamically based on what is available.
Section 1 — type: metrics-grid — Title: "Performance Snapshot"
Create one subsection per platform that returned data:
- Meta: Spend, Impressions, Clicks, CTR, CPM, CPC, Leads or Purchases
- Google Ads: Spend, Impressions, Clicks, Conversions, Conv. Value, ROAS, CPA
- TikTok: Spend, Impressions, Clicks, CTR, CPM, CPC, Conversions, Cost/Conv.
- LinkedIn: Spend, Impressions, Clicks, Leads
- Shopify: Gross Sales, Net Sales, Total Sales, Orders, AOV, Returning Customer Rate
If only one platform returned data, this section will have just one subsection — that is fine.
Section 2 — type: chart (doughnut) — Title: "Ad Spend Distribution by Platform"
Only include this section if TWO or more ad platforms returned spend data.
Convert all spend to USD equivalent. Note the conversion rate used in the caption.
Section 3 — type: chart (bar) — Title: "Impressions by Platform"
Only include this section if TWO or more platforms returned impression data.
Section 4 — type: chart (bar) — Title: "Efficiency Metrics — CTR & CPC"
Only include this section if TWO or more platforms returned CTR and CPC data.
Show CTR (%) and CPC (USD equivalent) side by side.
Section 5 — type: table — Title: "Google Ads Campaign Breakdown"
Only include this section if GOOGLE_ADS_CUSTOMER_ID is not empty and data was returned.
Columns: Campaign Name | Spend | Impressions | Clicks | CTR | Conversions | Conv. Value | ROAS | CPA
Include a TOTAL row at the bottom.
Section 6 — type: chart (bar) — Title: "Shopify Sales Funnel"
Only include this section if SHOPIFY_ACCOUNT_ID is not empty and data was returned.
Bars: Gross Sales → Discounts → Net Sales → Total Sales
Include Orders, AOV, and Returning Customer Rate in the caption.
Section 7 — type: text — Title: "Observations & Data Gaps"
Always include this section.
For each platform that returned data: write 2–3 sentences summarising performance.
For each platform that was skipped due to an empty ID: note it so the user knows they can add it next time.
For each platform that failed despite having an ID: note the error so the user knows what to reconnect.
---
### FORMATTING RULES
- Report title: "Cross Platform Audit"
- Subtitle: include the date range and list which platforms are included
- Display each platform's spend in its native currency in metric cards
- Use USD equivalents only in cross-platform comparison charts
- For Google Ads cost: always divide cost_micros by 1,000,000
- Never fabricate or estimate data — only use what the tools return
- If only one platform has data, still generate the full report — single-platform reports are valid
---
### DATA INTEGRITY RULES
- Google Ads cost_micros: ALWAYS divide by 1,000,000 — never display raw micros
- Meta purchases: use omni_purchase ONLY — never sum multiple purchase action types
- LinkedIn errors: log in Section 7, never skip silently
- Shopify figures are store-level actuals, not ad-attributed — state this clearly
- Currency: display natively per platform, convert to USD only for cross-platform charts