ids: Limit result to items with specified product or campaign ids
fields: Limit totals to the provided fields (sales, spend, clicks, impressions, and/or conversions)
order: asc or desc (default)
orderby: String (one of the requested fields)
per_page: Integer (default 200, min 1, max 1000)
next_page: String (token to retrieve the next page)
interval: day (default), week, month, quarter, year
For this milestone, we can use the following arguments:
before and after to request the selected date range
fields to limit the response to sales and spend (we will only use these two fields in M1, but we should support requests for any of the supported fields, which we will use in M2)
orderby to have the response ordered by sales
Note: If the Google Ads account is connected but there are no campaigns, the API can return null values (e.g. the campaigns field is null rather than an empty array).
We need to add support in the networking layer for the following endpoints:
Connection
Request to check if the Google Ads account is connected:
GET /wc/gla/ads/connection
status
field has valueconnected
Analytics
Request for campaign analytics:
GET /wc/gla/ads/reports/programs
after
: Date string (default 7 days ago)before
: Date string (default now)ids
: Limit result to items with specified product or campaign idsfields
: Limit totals to the provided fields (sales
,spend
,clicks
,impressions
, and/orconversions
)order
:asc
ordesc
(default)orderby
: String (one of the requested fields)per_page
: Integer (default 200, min 1, max 1000)next_page
: String (token to retrieve the next page)interval
:day
(default),week
,month
,quarter
,year
before
andafter
to request the selected date rangefields
to limit the response tosales
andspend
(we will only use these two fields in M1, but we should support requests for any of the supported fields, which we will use in M2)orderby
to have the response ordered bysales
null
values (e.g. thecampaigns
field isnull
rather than an empty array).Sample response with no campaigns (and with
data
envelope):