Fetch metrics for Waze Ads campaigns.
The reporting guide provides example queries and describes the basics of using generateReport
.
Note that data from this method may be as much as 12 hours old, so recent metrics and changes to resources are not reflected in the reports.
HTTP request
POST https://ads.wazeapis.com/v1/{account=accounts/*}:generateReport
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
account |
Required. The resource name of the account. |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "startDate": { object ( |
Fields | |
---|---|
startDate |
Required. First date to include in the report. |
endDate |
Required. Last date to include in the report. |
fields[] |
Required. Fields to include in the report. In the response, rows are grouped by all fields, except those which start with the prefix
|
pageSize |
The maximum number of rows to return. The service might return fewer than this value. If unspecified, at most 50 rows are returned. The maximum value is 1000; values above 1000 are coerced to 1000. |
pageToken |
A page token, received from a previous When paginating, all other parameters provided to The token will expire and is not guaranteed to work indefinitely. |
order[] |
The fields that the rows in the report are to be sorted by. |
filters[] |
Filters to only include rows that meet specific conditions in the report. Only rows that match all of the filters in the request are returned in the response. |
Response body
If successful, the response body contains data with the following structure:
JSON representation |
---|
{
"headers": [
string
],
"rows": [
{
object ( |
Fields | |
---|---|
headers[] |
Headers that are included in the report. These match the |
rows[] |
Values for each of the headers for each of the groupings. |
nextPageToken |
A token that can be sent as |
totalSize |
The total number of rows of the response across all pages. If a filter was included in the request this reflects the total number of rows after filtering. |
Order
How to order the rows of the report. Consider the following:
order: {
sort: "ASC"
field: "date"
}
In this example the rows of the report are sorted in ascending order according to the date
values.
JSON representation |
---|
{
"sort": enum ( |
Fields | |
---|---|
sort |
Determines whether the sort is ascending or descending. |
field |
The field to sort by. Only fields that appear in the request |
Sort
Enums | |
---|---|
SORT_UNSPECIFIED |
|
ASC |
Sort by ascending order. |
DESC |
Sort by descending order. |
Filter
Conditions for which rows to include in the report. For example:
- Include only rows where
metric.impressionCount
is larger than 100:
filters: {
field: "metric.impressionCount"
operator: "GREATER_THAN"
value: "100"
}
- Include only rows where the
is "accounts/123/campaigns/456" or "accounts/123/campaigns/457".campaign.name
filters: {
field: "campaign.name"
operator: "IN"
values: [
"accounts/123/campaigns/456",
"accounts/123/campaigns/457"
]
}
JSON representation |
---|
{
"operator": enum ( |
Fields | |
---|---|
operator |
Filtering behavior. |
value |
Value to use for filtering. Required for all |
values[] |
Values to use for filtering. Required when the |
field |
A field that appears in the request |
Operator
Operators that can be used to specify conditions when generating a report.
Enums | |
---|---|
OPERATOR_UNSPECIFIED |
Operator unspecified. |
EQUAL |
The field is equal to the stated value. |
NOT_EQUAL_TO |
The field is not equal to the stated value. |
GREATER_THAN |
The field is greater than the stated value. |
GREATER_THAN_OR_EQUAL_TO |
The field is greater than or equal to the stated value. |
LESS_THAN |
The field is less than the stated value. |
LESS_THAN_OR_EQUAL_TO |
The field is less than or equal to the stated value. |
HAS_SUBSTRING |
The string field contains the specified substring. |
NOT_HAS_SUBSTRING |
The string field does not contain the specified substring. |
IN |
The field is in the array of values. |
NOT_IN |
The field is not in the array of values. |
Row
JSON representation |
---|
{ "values": [ string ], "privacyThresholdApplied": boolean } |
Fields | |
---|---|
values[] |
A value that corresponds to each of the headers. The name of enum values are printed, such as |
privacyThresholdApplied |
A boolean indicating whether or not the metric values in the row were omitted due to the number of impressions for this row not meeting the minimum privacy threshold. The reporting guide provides more information. |