Quick overview
This workflow pulls ad spend and platform-reported revenue from Meta (with placeholders for Google Ads and TikTok), combines it with your actual store revenue and new-customer count, calculates blended ROAS/MER and blended CAC plus over-claiming, and uses Anthropic Claude to generate a short executive efficiency brief.
How it works
- Runs manually to start the reconciliation for the configured date range.
- Loads the reporting window plus store revenue, new-customer count, and any additional platform spend/revenue inputs.
- Calls the Meta Marketing API to fetch account-level ad spend and conversion value, then merges it with the additional platform figures.
- Calculates total spend, total platform-reported revenue, blended ROAS/MER, blended CAC, and the over-claim amount and percentage, plus per-platform reported ROAS.
- Sends the reconciled metrics to Anthropic Claude to generate a terse JSON brief with a verdict, over-claim note, and recommended action.
- Prints a console scorecard with blended ROAS/MER, CAC, over-claiming, per-platform breakdown, and the Claude-generated brief.
Setup
- Set the environment variables META_ACCESS_TOKEN, META_AD_ACCOUNT_ID, and optionally META_API_VERSION for the Meta Marketing API request.
- Add your ANTHROPIC_API_KEY environment variable to enable the Anthropic Claude API call.
- Replace the mock store revenue and new-customer values with a real data source such as Shopify or Stripe, and replace the Google Ads and TikTok placeholder figures with real Google Ads and TikTok connectors if needed.
- Adjust the date_preset (for example, last_30d) and any extra platforms you want included in the blended metrics.
Requirements
- A Meta access token with ads_read on the ad account
- A store revenue source (Shopify or Stripe) for actual revenue and new-customer count
- An Anthropic API key (Claude)
- Optional: Google Ads and TikTok Ads access to include those platforms
Customization
- Replace STORE_REVENUE and NEW_CUSTOMERS in Config with a Shopify or Stripe node
- Replace the Google Ads and TikTok placeholders in EXTRA_PLATFORMS with real ad-platform nodes
- Adjust DATE_PRESET (e.g. last_30d)
Additional info
Built by nocode.expert (done-for-you automation and tracking). Computes blended ROAS, MER and CAC plus the platform over-claim gap that survives iOS attribution loss. All secrets read from environment variables.