diff --git a/skills/adapty-cli-setup/SKILL.md b/skills/adapty-cli-setup/SKILL.md index b71841b..e81af66 100644 --- a/skills/adapty-cli-setup/SKILL.md +++ b/skills/adapty-cli-setup/SKILL.md @@ -4,7 +4,7 @@ license: MIT description: Use when the Adapty CLI needs installing or authenticating before any Apple Search Ads work — a fresh Cowork or cloud session, "adapty: command not found", AuthRequiredError, an expired auth code, or connecting an Apple Search Ads account. Triggers on "install the Adapty CLI", "set up adapty", "adapty auth login", "connect Apple Search Ads", "not authenticated", or any Apple Ads request made in a session where the CLI is not yet installed. --- - # Adapty CLI setup @@ -144,6 +144,8 @@ the dashboard usually means the token is scoped elsewhere. - It dies with the shell. A token that works in one command and not the next was never exported, or was exported in a different process. +EU account: `adapty auth login --region eu` or `ADAPTY_REGION=eu`; after a damaged login file, run `adapty auth login --region us` or `--region eu` with the region of the account (with no region, the login stops at the damaged file too); if you do not know it, ask the user. A script with `ADAPTY_TOKEN` also sets `ADAPTY_REGION`: without it the command takes the region of the saved login, which can belong to another account. + `adapty auth login` works in a cloud session — the browser can be anywhere. **Never tell the user browser login is unavailable here, and never ask them for a token because the session is remote.** A token is something they may volunteer; it is never something you request as a substitute for diff --git a/skills/apple-ads/references/asa-management.md b/skills/apple-ads/references/asa-management.md index 9f2b6d0..0fd12a9 100644 --- a/skills/apple-ads/references/asa-management.md +++ b/skills/apple-ads/references/asa-management.md @@ -1,4 +1,4 @@ - # Apple Search Ads — Managing Campaigns @@ -29,7 +29,7 @@ Every `list` and `get` command in this file returns metadata only, no metrics. E | Command | Flags | Notes | |---|---|---| -| `asa campaigns list` | scope filters only | Metadata only. | +| `asa campaigns list` | scope filters only | Metadata only. Rows carry `creation_time`, `modification_time` and `time_zone` (the campaign group time zone); read launch dates in that zone, not UTC. | | `asa campaigns get ` | positional UUID | Metadata only. | | `asa campaigns create` | `--org`, `--name`, `--adam-id`, `--country` (repeatable), `--daily-budget`; optional `--status` (`ENABLED`/`PAUSED`, no default), `--target-cpa`, `--bidding-strategy`, `--supply-source` (repeatable, default `APPSTORE_SEARCH_RESULTS`), `--billing-event` (`IMPRESSIONS`/`TAPS`, default `TAPS`), `--ad-channel-type` (`DISPLAY`/`SEARCH`, default `SEARCH`), `--invoice-advertiser`, `--invoice-order-number`, `--invoice-contact-name`, `--invoice-contact-email`, `--invoice-billing-email` (all five together, LOC organizations only) | `--org` takes the UUID (`internal_id`) from `asa orgs list`, not that row's numeric `org_id`; `--adam-id` comes from `asa apps list`. `--status` has no default — pass `--status PAUSED` only when the user asks to launch without spending (see [Budget and serving](#budget-and-serving)). The response carries `serving_status` and `serving_state_reasons`; when the campaign is `NOT_RUNNING` the command prints the reason and the fixing command — see [Max Conversions](#max-conversions-campaigns) and [Line of credit](#line-of-credit-loc-organizations). | | `asa campaigns update ` | at least one of `--name`, `--status`, `--country`, `--daily-budget`, `--target-cpa`, `--bidding-strategy`, or `--invoice-advertiser`, `--invoice-order-number`, `--invoice-contact-name`, `--invoice-contact-email`, `--invoice-billing-email` together | The `--invoice-*` flags replace the stored Invoicing Options as a whole — pass all five, a partial set exits 2 before the network. | @@ -84,7 +84,7 @@ Invoicing Options. They map to `loc_invoice_details` in the request: advertiser | Command | Flags | Notes | |---|---|---| -| `asa ad-groups list` | scope filters only | Metadata only. | +| `asa ad-groups list` | scope filters only | Metadata only. Rows carry `campaign_external_id` (Apple's id) for joins with Apple or dashboard data. | | `asa ad-groups get ` | positional UUID | Metadata only. | | `asa ad-groups create` | `--campaign`, `--name`, `--default-bid` (optional with `--automated`); optional `--automated` | Apple also requires a pricing model and a start time; the CLI defaults `--pricing-model` to `CPC` (the only other option is `CPM`) and `--start-time` to today if you don't pass them. `--automated` creates the automated ad group a Max Conversions campaign needs: it implies automated keywords, sends no `start_time` (exits 2 if `--start-time` is also given), must be `ENABLED` (exits 2 on `--status PAUSED`) and does not require `--default-bid` — see [Max Conversions](#max-conversions-campaigns). | | `asa ad-groups update ` | at least one field | The campaign is resolved server-side and is never passed on update. | @@ -102,7 +102,8 @@ Invoicing Options. They map to `loc_invoice_details` in the request: advertiser | Command | Flags | Notes | |---|---|---| -| `asa keywords list` | scope filters only | Metadata only. Filter by `--ad-group` — unfiltered, this is the widest read in the surface. | +| `asa keywords list` | scope filters only; optional `--live-only` | Metadata only. Filter by `--ad-group` — unfiltered, this is the widest read in the surface. `--live-only` keeps ACTIVE keywords in an ENABLED ad group and ENABLED campaign with nothing deleted. Rows carry `effective_status`, `countries`, the parent statuses and external ids. | +| `asa keywords duplicates` | `--app` (required); optional `--country` (repeatable ISO code, scan only these countries), `--ignore-match-type` (group by country and text only) | The same keyword text, country and match level repeated across ad groups or campaigns of one app. Each group lists its `instances` (campaign, ad group, bid, `cpp_ab_test_id`); groups whose instances all belong to one CPP A/B test are already dropped, but a returned group can be mixed (some instances with a non-null `cpp_ab_test_id`, some without). Instances sharing one `cpp_ab_test_id` are variants of that test — never pause or delete them as duplicates; only instances outside the test (or in different tests) are candidates. Keyword text is compared exactly as stored, so `Brand` and `brand` are not grouped: check case variants yourself when it matters. At most 500 groups; `truncated: true` (and a warning in table mode) when capped. | | `asa keywords recommend` | `--adam-id` (Apple App Store ID from `asa apps list`), `--type` (`brand` / `generic` / `competitor`); optional `--country` (ISO code, repeatable) | Ready-made keyword pools computed by Adapty's Autopilot for one of your apps — the same sets the dashboard's campaign setup uses. `brand`: the app's own brand terms, spelling variants and organic terms carrying the brand. `generic`: non-brand terms the app and its top organic competitors rank for, minus every known brand term; `relevance_tier: top_organic` marks terms where the app is already in the organic top 10. `competitor`: one pool per competitor selected for the app in the dashboard's Autopilot setup — empty until the client selects competitors there. Read `status` before the list: `building` means come back later, `empty` is a real answer, `failed` needs a retry another day. A cold `brand` or `generic` call builds the pool in-request and can take tens of seconds; only one such call runs at a time per company (429 with `Retry-After` otherwise), and the budget is 10 calls a minute. Terms come without bids or match types — choose those per the playbook and load them with `asa keywords add`. | | `asa keywords add` | `--ad-group` plus `--text` (repeatable) and/or `--from-file`; optional `--bid`, `--match-type` (`BROAD`/`EXACT`, default `BROAD`), `--status` (`ACTIVE`/`PAUSED`, default `ACTIVE`) | Batch call, capped at 100 keywords per call — the skill's own practice caps a single call lower, at 15 (see `SKILL.md`'s `## Never`). `--from-file` reads one keyword per line, trims each line, drops blank lines, and combines the result with any `--text` values. Default match type is `BROAD`, which widens spend beyond exact matches; pass `--match-type EXACT` to narrow it. | | `asa keywords update [...]` | one or more positional ids | The same change (e.g. `--bid`, `--status`) is applied to every id in the list. `--text` is only valid when a single id is given — you cannot bulk-rename keyword text. | @@ -294,7 +295,8 @@ a different code from `cli_analytics_busy` (that other pool's concurrency cap) a out and retries the first 429 of any command on its own — the exact `Retry-After`, up to 60 seconds, cool-downs excluded — so a 429 that reaches you means the retry also failed and the budget is genuinely exhausted; don't loop, wait for the window to reset or reduce the -call. Twenty rejections within 5 minutes escalate any of these commands into +call. A rejection counts as a strike only when the same command is refused again before its +previous `Retry-After` has run out; twenty strikes within 5 minutes escalate into `429 cli_cooldown_active`, a cool-down scoped to the token (5m → 30m → 3h) that stops every `asa` command from that token, not just the one that tripped it. @@ -314,5 +316,5 @@ call. Twenty rejections within 5 minutes escalate any of these commands into - Keyword and negative-keyword calls are batches: one bad id fails the whole batch before Apple is called; Apple may still reject individual items within an otherwise valid batch, each with its own reason. -- Money flags take a bare amount (`--daily-budget 50`); `--currency` defaults to `USD`. +- Money flags take a bare amount (`--daily-budget 50`); `--currency` has no default: without it the CLI uses the campaign group's currency, and the backend rejects a different one with `cli_currency_mismatch`. - There is no delete command in the `asa` topic. diff --git a/skills/apple-ads/references/asa-metrics.md b/skills/apple-ads/references/asa-metrics.md index fc03994..cd73717 100644 --- a/skills/apple-ads/references/asa-metrics.md +++ b/skills/apple-ads/references/asa-metrics.md @@ -1,4 +1,4 @@ - # Apple Search Ads — Metrics and Analytics @@ -25,7 +25,7 @@ that field. |---|---|---| | `asa metrics` | `--entity`, `--date-from`, `--date-to`, `--metric` (repeatable) required; `--app`, `--campaign`, `--ad-group` (repeatable scope filters), `--group-by` (repeatable), `--order` (`asc`/`desc`, default `desc`), `--order-by`, `--by-days` (repeatable, max 16), `--order-by-day`, `--page` (default `1`), `--page-size` (default `100`, max `1000`) optional | One row per entity — `ad`, `ad-group`, `campaign`, or `keyword` — already aggregated over the period and already sorted server-side by `--order-by`. A top-N question is one call, `--order-by X --page-size N`; never paginate and sum yourself, and for a full breakdown take one big page (`--page-size 1000`) instead of looping. `--order` defaults to `desc`; pass `--order asc` for a "worst" question instead of "best." `--group-by` is one of `country`, `day`, `month`, `quarter`, `week`, `year`, and its coarseness sets the date-window cap (see [Date window caps](#date-window-caps)). Account-level totals are one call to `metrics overview` instead. | | `asa metrics overview` | `--entity`, `--date-from`, `--date-to` required; `--metric` (repeatable, root names only), `--by-days` (repeatable, max 16), `--period-unit` (`day`/`week`/`month`/`quarter`/`year`, default `day`) optional | Returns one response, not a list — totals for the whole entity level plus a per-period series in the same call, no pagination, no client-side summing. That's the one-call answer to a trend question ("today vs. yesterday," "this week vs. last"). Has no `--group-by` and no `--order`/`--order-by`/`--order-by-day`. Shares the 5-per-minute metrics budget with `metrics` (see [The analytics pool](#the-analytics-pool)). Metric names here are root names only — see [Metric vocabulary](#metric-vocabulary). | -| `asa search-terms list` | `--date-from` / `--date-to` (default: today); scope with `--ad-group` / `--campaign`; `--page` (default `1`), `--page-size` (default `100`, max `1000`) | The only list command in the `asa` topic that takes period flags — it draws on the same analytics pool as `metrics` (see [The analytics pool](#the-analytics-pool)), not the metadata store the other lists use. The full scope-filter set (`--app`, `--campaign-group`, `--search` included) is in `asa-management.md`. This file covers *reading* search terms; turning what you find into keywords or negative keywords is in `asa-management.md`. | +| `asa search-terms list` | `--date-from` / `--date-to` (default: today); scope with `--ad-group` / `--campaign`; `--page` (default `1`), `--page-size` (default `100`, max `1000`); optional `--overlap-only` | The only list command in the `asa` topic that takes period flags — it draws on the same analytics pool as `metrics` (see [The analytics pool](#the-analytics-pool)), not the metadata store the other lists use. The full scope-filter set (`--app`, `--campaign-group`, `--search` included) is in `asa-management.md`. `--overlap-only` keeps Search Match / Max Conversions terms that match a live EXACT keyword of the same app in a campaign covering the term's country and not blocked by a negative. Rows carry `is_negated`, `exact_keyword_overlap`, `campaign_external_id` and `ad_group_external_id`. This file covers *reading* search terms; turning what you find into keywords or negative keywords is in `asa-management.md`. | | `asa competitors summary` | `--app-ids` (1–5 Apple App Store IDs, comma-separated) | Covers the last full month across every country — there are deliberately no period or country flags. The first call on a cold cache can take tens of seconds. | ## Date window caps @@ -132,17 +132,24 @@ adapty asa metrics --entity campaign --date-from 2026-07-01 --date-to 2026-07-31 ### Windows the cohort has not lived through yet A cohort metric is what has actually been observed so far, not a projection. A window longer -than the cohort's age therefore repeats the last real figure instead of returning nothing — a -July cohort read in August reports the same number at day 60, day 90 and day 300 as at day 28. +than the cohort's age is `null` (blank cells in table mode), not the last real figure. Each +period row is cut at its own age. -`meta.max_valid_day` in the response is how many days the youngest cohort in the date range -has lived, counted from `--date-to`. Treat any `--by-days` window above it as not reached: +With a date `--group-by` (`day`, `week`, `month`, ...) each period row is cut at its own age. +Without one, `meta.max_valid_day` in the response is how many days the youngest cohort in the +request has lived, counted from `--date-to`, and it applies to every row. Treat any `--by-days` +window above the row's age as not reached: -- Do not divide a clipped numerator by a full-window denominator. That understates the result, - and by roughly a third in the case that prompted this note. +- Do not divide a clipped numerator by a full-window denominator. - Compare markets only at a window all of them have reached. -- The CLI prints a warning when a requested window is past `max_valid_day`; in `--json` the - number is there to check yourself. +- When a requested window is past `max_valid_day`, the CLI prints "Cohort windows a cohort has + not reached yet are null (blank cells); each period is cut at its own age." + +### `meta.units` and `meta.warnings` + +`meta.units` maps each metric to its unit: `percent` for ROAS/ROI, `null` when the catalog has +none (money is in the campaign group currency). `meta.warnings` lists caveats such as +`aggregated_across_countries` and `search_match_excluded`; table mode prints them to stderr. ## Money and currency @@ -204,7 +211,9 @@ excluded) and retries once. So a 429 that reaches you is the *second* attempt fa budget is genuinely exhausted for now. Don't loop on it — cut the number of calls in the plan, or tell the user when to retry. -20 rejections within 5 minutes put the token — not the whole company — into an escalating +A rejection counts as a strike only when the same command is refused again before the +`Retry-After` of its previous refusal has run out — waiting out the header never earns one. +20 strikes within 5 minutes put the token — not the whole company — into an escalating cool-down: `cli_cooldown_active`, 5m → 30m → 3h. Retrying during the pause does not extend it; the fix is calling less, not retrying harder.