Agent recipes

Step-by-step playbooks an agent (or a human) can follow with the MCP tools or the REST API — Google Ads setup, fraud investigation, smart-link design, offline conversions.

Updated 2026-09-02

Each recipe lists the tools in order. REST equivalents are in the API reference.

Recipe 1 — Set up certified Google Ads tracking#

  1. get_doctracking/transparency, tracking/template.
  2. list_domains → confirm the tracking domain is ACTIVE; if not, return the CNAME (edge.whichclick.is) and TXT records and stop.
  3. list_campaigns → reuse or create_campaign (external_id = Google Ads campaign id).
  4. create_tracking_link (domain, default_final_url, campaign_id) → returns tracking_template and final_url_suffix.
  5. Give the user the curl self-test from the response; after they paste the template, list_clicks (link_slug) to confirm forceTransparent=true clicks arrive.
  6. get_doctracking/compliance and walk through the checklist.

Recipe 2 — Investigate invalid clicks#

  1. get_protection_stats (days: 7) → invalid rate, reasons, top IPs, incidents.
  2. get_metric_timeseries (metric: invalid_rate, days: 30) → trend.
  3. lookup_ip on each top IP → type, ASN, org.
  4. list_clicks (limit: 200) → cross-check verdicts against campaigns / keywords.
  5. Recommend: block_ip for clear datacenter / VPN sources, a block rule on ipType in [DATACENTER, TOR] for smart links, and get_docprotect/google-ads-sync for the exclusion export. Ask before writing.
  1. get_docattribution/smart-links, attribution/routing-rules.
  2. list_apps → app id, scheme, universal-link host.
  3. Draft rules JSON; validate_routing_rules.
  4. create_smart_linkupdate_smart_link_routing.
  5. test_smart_link_route for iOS / Android / desktop / in-app-browser / target-country profiles; report each decision.

Recipe 4 — Offline conversion import to Google Ads#

  1. list_clicks (since, limit: 500) or GET /api/v1/clicks paged by since.
  2. Join CRM outcomes on wc_click_id; keep gclid, gbraid, wbraid.
  3. Build the Google Ads offline conversion upload (gclid, conversion name, time in the account timezone, value, currency).
  4. Mirror each outcome into WhichClick with record_conversion (order_id for idempotency) so ROAS matches.

Recipe 5 — Weekly performance summary#

  1. get_overview (days: 7) and get_pivot_report (dimension: campaign).
  2. get_cohorts (weeks: 4) for retention and LTV.
  3. recent_alerts for anything open.
  4. Summarise spend, CPI, ROAS, invalid rate, notable movers; link to https://app.whichclick.is/dashboard.

Recipe 6 — Ship the mobile SDK#

  1. get_docattribution/sdk, attribution/methods.
  2. list_apps → SDK key (masked; the user copies it from the dashboard).
  3. Produce platform code for configure / consent / deep links / events from the SDK page.
  4. Verify with list_clicksget_metric_timeseries (installs) after the first test install.