Display & Video 360 API . advertisers . reachForecast

Instance Methods

close()

Close httplib2 connections.

generateReachForecast(advertiserId, body=None, x__xgafv=None)

Generates a reach forecast for a given advertiser and targeting configuration.

retrievePlannableLocations(advertiserId, x__xgafv=None)

Retrieves the list of countries where reach forecasting is supported.

retrievePlannableProducts(advertiserId, plannableLocationId=None, x__xgafv=None)

Retrieves the list of products that can be planned for a location.

retrievePlannableUserInterests(advertiserId, productCategory=None, x__xgafv=None)

Retrieves Google Audiences (User Interests) available for forecasting.

retrievePlannableUserLists(advertiserId, filter=None, pageSize=None, pageToken=None, x__xgafv=None)

Retrieves first and third party user lists available for forecasting.

retrievePlannableUserLists_next()

Retrieves the next page of results.

Method Details

close()
Close httplib2 connections.
generateReachForecast(advertiserId, body=None, x__xgafv=None)
Generates a reach forecast for a given advertiser and targeting configuration.

Args:
  advertiserId: string, Required. The ID of the advertiser that will run the planned campaign. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for ReachForecastService.GenerateReachForecast.
  "campaignDuration": { # The duration of the reach plan. # Required. The duration of the planned campaign.
    "dateRange": { # A date range. # Required. The date range the plan covers.
      "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 # The upper bound of the date range, inclusive. Must specify a positive value for `year`, `month`, and `day`.
        "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 # The lower bound of the date range, inclusive. Must specify a positive value for `year`, `month`, and `day`.
        "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.
      },
    },
    "durationDays": 42, # Required. The number of days the plan covers.
  },
  "currencyCode": "A String", # Required. The currency code for the plan in ISO 4217 format.
  "effectiveFrequencyBreakdownLimit": 42, # Optional. The highest minimum effective frequency to include in PlannedProductForecast.effective_frequency_breakdowns. Must be between 1 and 10, inclusive. If not specified, PlannedProductForecast.effective_frequency_breakdowns will not be populated. If set, this value will also be used as the minimum effective frequency for reach metrics reporting. This field cannot be combined with the min_effective_frequency field.
  "minEffectiveFrequency": 42, # Optional. The minimum effective frequency for the reported reach metrics. This is the smallest number of times a customer must be exposed to the ad for it to be considered effective. This setting only impacts reporting. Must be between 1 and 10, inclusive. If not specified, a default of 1 is applied. This field cannot be combined with effective_frequency_breakdown_limit.
  "plannedProducts": [ # Required. The list of line items to include in the forecast.
    { # Configuration for a specific product in the plan.
      "advancedProductTargeting": { # Product-specific targeting overrides. # Optional. Optional line item level targeting overrides.
        "ageRange": "A String", # Optional. The age range to target.
        "dateRange": { # A date range. # Optional. The date range to target.
          "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 # The upper bound of the date range, inclusive. Must specify a positive value for `year`, `month`, and `day`.
            "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 # The lower bound of the date range, inclusive. Must specify a positive value for `year`, `month`, and `day`.
            "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.
          },
        },
        "devices": [ # Optional. The devices to target.
          "A String",
        ],
        "frequencyCap": { # Settings that control the number of times a user may be shown with the same ad during a given time period. # Optional. The frequency cap for the specific product.
          "maxImpressions": 42, # The maximum number of times a user may be shown the same ad during this period. Must be greater than 0. Required when unlimited is `false` and max_views is not set.
          "maxViews": 42, # Optional. The maximum number of times a user may click-through or fully view an ad during this period until it is no longer served to them. Must be greater than 0. Only applicable to YouTube and Partners resources. Required when unlimited is `false` and max_impressions is not set.
          "timeUnit": "A String", # The time unit in which the frequency cap will be applied. Required when unlimited is `false`.
          "timeUnitCount": 42, # The number of time_unit the frequency cap will last. Required when unlimited is `false`. The following restrictions apply based on the value of time_unit: * `TIME_UNIT_MONTHS` - must be 1 * `TIME_UNIT_WEEKS` - must be between 1 and 4 * `TIME_UNIT_DAYS` - must be between 1 and 6 * `TIME_UNIT_HOURS` - must be between 1 and 23 * `TIME_UNIT_MINUTES` - must be between 1 and 59
          "unlimited": True or False, # Whether unlimited frequency capping is applied. When this field is set to `true`, the remaining frequency cap fields are not applicable.
        },
        "genders": [ # Optional. The gender options to target.
          "A String",
        ],
        "plannableLocationIds": [ # Optional. Plannable location IDs to target.
          "A String",
        ],
        "surfaceTargetingSettings": { # Surface targeting selection. # Optional. Plannable surfaces to target.
          "surfaces": [ # Optional. The surfaces to target.
            "A String",
          ],
        },
        "targetFrequency": { # Setting that controls the average number of times the ads will show to the same person over a certain period of time. # Optional. The average number of times the ads will show to the same person over a certain period of time.
          "targetCount": "A String", # The target number of times, on average, the ads will be shown to the same person in the timespan dictated by time_unit and time_unit_count.
          "timeUnit": "A String", # The unit of time in which the target frequency will be applied. The following time unit is applicable: * `TIME_UNIT_WEEKS`
          "timeUnitCount": 42, # The number of time_unit the target frequency will last. The following restrictions apply based on the value of time_unit: * `TIME_UNIT_WEEKS` - must be 1
        },
        "userInterestIds": [ # Optional. The user interest IDs to target. Plannable user interests can be retrieved using the `RetrievePlannableUserInterests` method.
          "A String",
        ],
        "userListIds": [ # Optional. The user list IDs to target. Plannable user lists can be retrieved using the `RetrievePlannableUserInterests` method.
          "A String",
        ],
        "youtubeSelectSettings": { # Settings for YouTube Select Lineups. # Optional. YouTube Select settings.
          "lineupId": "A String", # Optional. The ID of the YouTube Select Lineup.
        },
      },
      "budgetMicros": "A String", # Required. The budget for this product in micros.
      "plannableProductCode": "A String", # Required. The code for the product, e.g. "VIDEO_REACH_CAMPAIGN".
    },
  ],
  "targeting": { # Targeting settings for a planned campaign. # Required. The targeting parameters of the planned campaign.
    "ageRange": "A String", # Optional. The age range to target.
    "devices": [ # Optional. The devices to target.
      "A String",
    ],
    "genders": [ # Optional. The gender options to target.
      "A String",
    ],
    "plannableLocationIds": [ # Required. IDs of plannable locations to target. Plannable locations can be retrieved using the `RetrievePlannableLocations` method.
      "A String",
    ],
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for ReachForecastService.GenerateReachForecast.
  "onTargetAudienceMetrics": { # Estimated audience sizes for a targeted geography. # The estimated audience sizes for the targeted geography.
    "censusAudienceSize": "A String", # Size of the audience based on the census data of the targeted geography.
    "youtubeAudienceSize": "A String", # Estimated size of the YouTube audience.
  },
  "reachCurve": { # The generated reach curve. # The generated forecast curve.
    "reachForecasts": [ # Points along the curve, ordered by cost.
      { # A single point in the reach curve.
        "costMicros": "A String", # Total cost for this point in micros.
        "forecast": { # Performance metrics for a forecast point. # Aggregate forecast for the entire plan.
          "effectiveFrequencyBreakdowns": [ # A list of effective frequency breakdowns.
            { # A breakdown of the number of unique people reached at a given effective frequency.
              "effectiveCoviewReach": "A String", # The number of unique individuals, including co-viewers, exactly matching the targeting that were served the ad at least the number of times dictated by the effective_frequency.
              "effectiveFrequency": 42, # The set effective frequency.
              "onTargetEffectiveCoviewReach": "A String", # The total number of unique individuals, including co-viewers that were served the ad at least the number of times dictated by the effective_frequency. This includes individuals that may fall outside of targeting.
              "onTargetReach": "A String", # The number of unique individuals exactly matching the targeting that were served the ad at least the number of times dictated by the effective_frequency.
              "totalReach": "A String", # The total number of unique individuals that were served the ad at least the number of times dictated by the effective_frequency. This includes individuals that may fall outside of targeting.
            },
          ],
          "onTargetImpressions": "A String", # Number of on-target impressions.
          "onTargetReach": "A String", # Number of unique people reached that match the on-target definition.
          "totalImpressions": "A String", # Total number of impressions.
          "totalReach": "A String", # Total number of unique people reached.
          "trueviewViews": "A String", # Number of TrueView views.
          "viewableImpressions": "A String", # Number of viewable impressions.
        },
        "plannedProductReachForecasts": [ # Breakdown for individual products at this cost point.
          { # Performance forecast for a specific product.
            "costMicros": "A String", # The cost in micros for this product.
            "plannableProductCode": "A String", # The code for the product.
            "plannedProductForecast": { # Performance metrics for a forecast point. # Performance metrics for the product.
              "effectiveFrequencyBreakdowns": [ # A list of effective frequency breakdowns.
                { # A breakdown of the number of unique people reached at a given effective frequency.
                  "effectiveCoviewReach": "A String", # The number of unique individuals, including co-viewers, exactly matching the targeting that were served the ad at least the number of times dictated by the effective_frequency.
                  "effectiveFrequency": 42, # The set effective frequency.
                  "onTargetEffectiveCoviewReach": "A String", # The total number of unique individuals, including co-viewers that were served the ad at least the number of times dictated by the effective_frequency. This includes individuals that may fall outside of targeting.
                  "onTargetReach": "A String", # The number of unique individuals exactly matching the targeting that were served the ad at least the number of times dictated by the effective_frequency.
                  "totalReach": "A String", # The total number of unique individuals that were served the ad at least the number of times dictated by the effective_frequency. This includes individuals that may fall outside of targeting.
                },
              ],
              "onTargetImpressions": "A String", # Number of on-target impressions.
              "onTargetReach": "A String", # Number of unique people reached that match the on-target definition.
              "totalImpressions": "A String", # Total number of impressions.
              "totalReach": "A String", # Total number of unique people reached.
              "trueviewViews": "A String", # Number of TrueView views.
              "viewableImpressions": "A String", # Number of viewable impressions.
            },
          },
        ],
      },
    ],
  },
}
retrievePlannableLocations(advertiserId, x__xgafv=None)
Retrieves the list of countries where reach forecasting is supported.

Args:
  advertiserId: string, Required. The ID of the advertiser to list plannable locations for. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response for RetrievePlannableLocations
  "plannableLocations": [ # Output only. The list of plannable locations.
    { # A plannable location used for forecasting.
      "displayName": "A String", # Output only. The display name of the location, for example "Algeria".
      "geoRegionType": "A String", # Output only. The type of location.
      "name": "A String", # Output only. The resource name of the plannable location.
      "plannableLocationId": "A String", # Output only. The plannable location ID.
      "regionCode": "A String", # Output only. The region code of the location, for example "DZ" for Algeria.
    },
  ],
}
retrievePlannableProducts(advertiserId, plannableLocationId=None, x__xgafv=None)
Retrieves the list of products that can be planned for a location.

Args:
  advertiserId: string, Required. The ID of the advertiser to list plannable products for. (required)
  plannableLocationId: string, Required. The ID of the plannable location.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response for RetrievePlannableProducts
  "productMetadata": [ # Output only. The list of product metadata showing targeting possibilities.
    { # Metadata for a plannable product.
      "displayName": "A String", # Output only. The name associated with the ad product. For example: "Video View Campaign".
      "plannableProductCode": "A String", # Output only. The plannable product code (e.g. "YOUTUBE_REACH_MIX").
      "plannableProductDescription": "A String", # Output only. The plain-text description of the ad product.
      "plannableTargeting": { # Targeting capabilities for a given product. # Output only. The targeting capabilities available for this product.
        "ageRanges": [ # Output only. Allowed plannable age ranges for the product. Actual targeting is computed by mapping this age range onto standard Google age targeting.
          "A String",
        ],
        "devices": [ # Output only. Targetable devices for the ad product.
          "A String",
        ],
        "genders": [ # Output only. Targetable genders for the ad product.
          "A String",
        ],
        "networks": [ # Output only. Targetable networks for the ad product.
          "A String",
        ],
        "surfaceTargetingCombinations": { # Surface targeting rules. # Output only. Targetable surface combinations for the ad product.
          "availableSurfaceTypes": [ # Output only. The surface types available.
            "A String",
          ],
          "validSurfaceCombinations": [ # Output only. Valid combinations of surfaces that can be selected together.
            { # A valid combination of surfaces.
              "choices": [ # Output only. The combination of surfaces.
                "A String",
              ],
            },
          ],
        },
        "youtubeSelectLineups": [ # Output only. Targetable YouTube Select Lineups for the ad product.
          { # A Plannable YouTube Select Lineup for product targeting.
            "displayName": "A String", # Output only. The display name of the YouTube Select Lineup.
            "lineupId": "A String", # Output only. The ID of the YouTube Select Lineup.
          },
        ],
      },
    },
  ],
}
retrievePlannableUserInterests(advertiserId, productCategory=None, x__xgafv=None)
Retrieves Google Audiences (User Interests) available for forecasting.

Args:
  advertiserId: string, Required. The ID of the advertiser to list plannable user interests for. (required)
  productCategory: string, Required. The product category to retrieve plannable user interests for.
    Allowed values
      PLANNABLE_PRODUCT_CATEGORY_UNSPECIFIED - Not specified.
      YOUTUBE - YouTube.
      OPEN_AUCTION - Open Auction.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response for RetrievePlannableUserInterests.
  "plannableUserInterests": [ # The list of plannable user interests (Google Audiences).
    { # A plannable user interest used for targeting.
      "userInterest": { # The identifier for a user interest. # Output only. The identifier for the user interest. The product_category specified in the request dictates the field populated in the object. * user_interest_category is populated for "Youtube". * user_interest_user_list is populated for "Open Auction".
        "userInterestCategory": "A String", # Output only. The resource name of the interest category. Populated when `product_category` is "Youtube". Format: customers/{customer_id}/userInterests/{user_interest_id}
        "userInterestUserList": "A String", # Output only. The resource name of the user list. Populated when `product_category` is "Open Auction". Format: customers/{customer_id}/userLists/{user_list_id}
      },
      "userInterestDisplayName": "A String", # Output only. The display name of the interest, for example "Outdoor Enthusiasts".
      "userInterestPath": "A String", # Output only. The category path of the interest.
      "userInterestType": "A String", # Output only. The type of audience, e.g., "AFFINITY", "IN_MARKET".
    },
  ],
}
retrievePlannableUserLists(advertiserId, filter=None, pageSize=None, pageToken=None, x__xgafv=None)
Retrieves first and third party user lists available for forecasting.

Args:
  advertiserId: string, Required. The ID of the advertiser to retrieve plannable user lists for. (required)
  filter: string, Optional. Allows filtering by plannable user list properties. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions can be combined by `AND` or `OR` logical operators. * A restriction has the form of `{field} {operator} {value}`. * The `updateTime` field must use the `GREATER THAN OR EQUAL TO (>=)` or `LESS THAN OR EQUAL TO (<=)` operators. * All other fields must use the `EQUALS (=)` operator. Supported fields: * `plannableStatus` Examples: * All plannable user lists: `plannableStatus="PLANNABLE"` The length of this field should be no more than 500 characters. Reference our [filter `LIST` requests](/display-video/api/guides/how-tos/filters) guide for more information.
  pageSize: integer, Optional. Requested page size. Must be between `1` and `5000`. If unspecified will default to `5000`.
  pageToken: string, Optional. A token identifying a page of results the server should return. Typically, this is the value of next_page_token returned from the previous call to `RetrievePlannableUserLists` method. If not specified, the first page of results will be returned.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response for RetrievePlannableUserLists.
  "nextPageToken": "A String", # Output only. A token to retrieve the next page of results.
  "plannableUserLists": [ # Output only. The list of plannable user lists.
    { # A plannable user list used for reach forecasting.
      "displayName": "A String", # Output only. The display name of the user list.
      "name": "A String", # Output only. The resource name identifying the user list. Format: `advertisers/{advertiser_id}/userLists/{user_list_id}`
      "plannableStatus": "A String", # Output only. The plannability status of the user list.
      "userListType": "A String", # Output only. The type of the user list.
    },
  ],
}
retrievePlannableUserLists_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.