Campaigns
get_campaignsEvery ad campaign (Meta, Google and the other ad platforms) over the period, largest spend first, with largestFalls and largestRises already ranked by the change in what the platform claims (compare for last year, or compareFrom and compareTo): spend, the revenue the PLATFORM claims for it (claimedRevenue) and roas (claimedRevenue ÷ spend), with the previous period's spend, claim and ROAS beside them (priorSpend, priorClaimedRevenue, priorRoas; null when comparable is false). Claims are each platform's own and overlap — never add them up into store revenue. name null = the campaign was never named in the sync, quote its id. Use for 'which campaigns spend the most', 'best and worst campaigns', 'how did campaign X do'. For Nuira's own attribution per campaign use get_sales; for Google products inside Shopping and Performance Max use get_google_product_split. Optional from and to (inclusive YYYY-MM-DD, both or neither, never after today) read another span instead of the default period. A named month, a week or two dates the operator gave MUST be sent here: without them this reads the last 30 days, which is not that month.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Last day of the span, inclusive, as YYYY-MM-DD; not after today. Send together with `from`, or omit both to read the default 30-day period. | |
| from | No | First day of the span, inclusive, as YYYY-MM-DD. Send together with `to`, or omit both to read the default 30-day period. | |
| compare | No | What to compare the span with: previous (default, the same number of days just before), yoy (the same dates last year) or yoyWeekday (52 weeks back, the same weekdays — use it for natural Monday–Sunday weeks or whenever the operator says 'last year' over weeks). | |
| compareTo | No | Last day of the named comparison period, YYYY-MM-DD. | |
| compareFrom | No | First day of a NAMED comparison period, YYYY-MM-DD, with compareTo. For 'September with October': from/to October, compareFrom/compareTo the whole of September. Takes the place of compare. |