Close httplib2 connections.
generate(parent, body=None, x__xgafv=None)
Generates Campaign Report based on provided specifications.
close()
Close httplib2 connections.
generate(parent, body=None, x__xgafv=None)
Generates Campaign Report based on provided specifications. Args: parent: string, Resource name of the account to generate the report for. Example: accounts/pub-9876543210987654 (required) body: object, The request body. The object takes the form of: { # Request to generate campaign report. "reportSpec": { # The specification for generating a Campaign report. For example, the specification to get IMPRESSIONS and CLICKS sliced by CAMPAIGN_ID can look like the following example: { "date_range": { "start_date": {"year": 2021, "month": 12, "day": 1}, "end_date": {"year": 2021, "month": 12, "day": 30} }, "dimensions": ["CAMPAIGN_ID"], "metrics": ["IMPRESSIONS", "CLICKS"], } # Campaign report specification. "dateRange": { # Specification of a single date range. Both dates are inclusive. # The date range for which the report is generated. The max range is 30 days. "endDate": { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # End date of the date range, inclusive. Must be greater than or equal to the start date. "day": 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. "month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. "year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. }, "startDate": { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Start date of the date range, inclusive. Must be less than or equal to the end date. "day": 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. "month": 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. "year": 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. }, }, "dimensions": [ # List of dimensions of the report. The value combination of these dimensions determines the row of the report. If no dimensions are specified, the report returns a single row of requested metrics for the entire account. "A String", ], "languageCode": "A String", # Language used for any localized text, such as certain applicable dimension values. The language tag is defined in the IETF BCP47. Defaults to 'en-US' if unspecified or invalid. "metrics": [ # List of metrics of the report. A report must specify at least one metric. "A String", ], }, } x__xgafv: string, V1 error format. Allowed values 1 - v1 error format 2 - v2 error format Returns: An object of the form: { # Campaign Report API response. "rows": [ # The campaign report data from the specified publisher. At most 100000 rows will be returned from the API. { # A row of the returning report. "dimensionValues": { # Map of dimension values in a row, with keys as enum name of the dimensions. "a_key": { # Representation of a dimension value. "displayLabel": "A String", # The localized string representation of the value. If unspecified, the display label should be derived from the value. "value": "A String", # Dimension value in the format specified in the report's spec Dimension enum. }, }, "metricValues": { # Map of metric values in a row, with keys as enum name of the metrics. If a metric being requested has no value returned, the map will not include it. "a_key": { # Representation of a metric value. "doubleValue": 3.14, # Double precision (approximate) decimal values. Rates are from 0 to 1. "integerValue": "A String", # Metric integer value. "microsValue": "A String", # Amount in micros. One million is equivalent to one unit. Currency value is in the unit (USD, EUR or other) specified by the request. For example, $6.50 whould be represented as 6500000 micros. }, }, }, ], }