Search Ads 360 Reporting API . customers . sharedCriteria

Instance Methods

close()

Close httplib2 connections.

mutate(customerId, body=None, x__xgafv=None)

Creates or removes shared criteria. Operation statuses are returned. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CriterionError]() [DatabaseError]() [DistinctError]() [FieldError]() [HeaderError]() [IdError]() [InternalError]() [MutateError]() [NotEmptyError]() [NullError]() [OperatorError]() [QuotaError]() [RangeError]() [RequestError]() [ResourceCountLimitExceededError]() [SizeLimitError]() [StringFormatError]() [StringLengthError]()

Method Details

close()
Close httplib2 connections.
mutate(customerId, body=None, x__xgafv=None)
Creates or removes shared criteria. Operation statuses are returned. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [CriterionError]() [DatabaseError]() [DistinctError]() [FieldError]() [HeaderError]() [IdError]() [InternalError]() [MutateError]() [NotEmptyError]() [NullError]() [OperatorError]() [QuotaError]() [RangeError]() [RequestError]() [ResourceCountLimitExceededError]() [SizeLimitError]() [StringFormatError]() [StringLengthError]()

Args:
  customerId: string, Required. The ID of the customer whose shared criteria are being modified. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for SharedCriterionService.MutateSharedCriteria.
  "operations": [ # Required. The list of operations to perform on individual shared criteria.
    { # A single operation (create, remove) on an shared criterion.
      "create": { # A criterion belonging to a shared set. # Create operation: No resource name is expected for the new shared criterion.
        "brand": { # Represents a Brand Criterion used for targeting based on commercial knowledge graph. # Immutable. Brand.
          "displayName": "A String", # Output only. A text representation of a brand.
          "entityId": "A String", # The Commercial KG MID for the brand.
          "primaryUrl": "A String", # Output only. The primary url of a brand.
          "rejectionReason": "A String", # Output only. The rejection reason when a brand status is REJECTED.
          "status": "A String", # Output only. The status of a brand.
        },
        "criterionId": "A String", # Output only. The ID of the criterion. This field is ignored for mutates.
        "keyword": { # A keyword criterion. # Immutable. Keyword.
          "matchType": "A String", # The match type of the keyword.
          "text": "A String", # The text of the keyword (at most 80 characters and 10 words).
        },
        "mobileAppCategory": { # A mobile app category criterion. # Immutable. Mobile App Category.
          "mobileAppCategoryConstant": "A String", # The mobile app category constant resource name.
        },
        "mobileApplication": { # A mobile application criterion. # Immutable. Mobile application.
          "appId": "A String", # A string that uniquely identifies a mobile application to Google Ads API. The format of this string is "{platform}-{platform_native_id}", where platform is "1" for iOS apps and "2" for Android apps, and where platform_native_id is the mobile application identifier native to the corresponding platform. For iOS, this native identifier is the 9 digit string that appears at the end of an App Store URL (for example, "476943146" for "Flood-It! 2" whose App Store link is "http://itunes.apple.com/us/app/flood-it!-2/id476943146"). For Android, this native identifier is the application's package name (for example, "com.labpixies.colordrips" for "Color Drips" given Google Play link "https://play.google.com/store/apps/details?id=com.labpixies.colordrips"). A well formed app id for Google Ads API would thus be "1-476943146" for iOS and "2-com.labpixies.colordrips" for Android. This field is required and must be set in CREATE operations.
          "name": "A String", # Name of this mobile application.
        },
        "negative": True or False, # Immutable. If true, the criterion is excluded. If false, the criterion is targeted.
        "placement": { # A placement criterion. This can be used to modify bids for sites when targeting the content network. # Immutable. Placement.
          "url": "A String", # URL of the placement. For example, "http://www.domain.com".
        },
        "resourceName": "A String", # Immutable. The resource name of the shared criterion. Shared set resource names have the form: `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}`
        "sharedSet": "A String", # Immutable. The shared set to which the shared criterion belongs.
        "type": "A String", # Output only. The type of the criterion.
        "verticalAdsItemGroupRule": { # A criterion to represent a single item group rule in Vertical Ads. # Immutable. Vertical ads item group rule.
          "cityCriterionId": "A String", # The resource name of the Geo Target Constant for the city.
          "countryCriterionId": "A String", # The resource name of the Geo Target Constant for the country.
          "hotelClass": "A String", # Integer value specifying the class rating for a hotel. Ranges from 1 to 5 stars.
          "itemCode": "A String", # The id specifying a particular Vertical Ad listing.
          "regionCriterionId": "A String", # The resource name of the Geo Target Constant for the region.
        },
        "webpage": { # Represents a criterion for targeting webpages of an advertiser's website. # Immutable. Webpage.
          "conditions": [ # Conditions, or logical expressions, for webpage targeting. The list of webpage targeting conditions are and-ed together when evaluated for targeting. An empty list of conditions indicates all pages of the campaign's website are targeted. This field is required for CREATE operations and is prohibited on UPDATE operations.
            { # Logical expression for targeting webpages of an advertiser's website.
              "argument": "A String", # Argument of webpage targeting condition.
              "operand": "A String", # Operand of webpage targeting condition.
              "operator": "A String", # Operator of webpage targeting condition.
            },
          ],
          "coveragePercentage": 3.14, # Website criteria coverage percentage. This is the computed percentage of website coverage based on the website target, negative website target and negative keywords in the ad group and campaign. For instance, when coverage returns as 1, it indicates it has 100% coverage. This field is read-only.
          "criterionName": "A String", # The name of the criterion that is defined by this parameter. The name value will be used for identifying, sorting and filtering criteria with this type of parameters. This field is required for CREATE operations and is prohibited on UPDATE operations.
          "sample": { # List of sample urls that match the website target # List of sample urls that match the website target. This field is read-only.
            "sampleUrls": [ # Webpage sample urls
              "A String",
            ],
          },
        },
        "youtubeChannel": { # A YouTube Channel criterion. # Immutable. YouTube Channel.
          "channelId": "A String", # The YouTube uploader channel id or the channel code of a YouTube channel.
        },
        "youtubeVideo": { # A YouTube Video criterion. # Immutable. YouTube Video.
          "videoId": "A String", # YouTube video id as it appears on the YouTube watch page.
        },
      },
      "remove": "A String", # Remove operation: A resource name for the removed shared criterion is expected, in this format: `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}`
    },
  ],
  "partialFailure": True or False, # If true, successful operations will be carried out and invalid operations will return errors. If false, all operations will be carried out in one transaction if and only if they are all valid. Default is false.
  "responseContentType": "A String", # The response content type setting. Determines whether the mutable resource or just the resource name should be returned post mutation.
  "validateOnly": True or False, # If true, the request is validated but not executed. Only errors are returned, not results.
}

  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 a shared criterion mutate.
  "partialFailureError": { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # Errors that pertain to operation failures in the partial failure mode. Returned only when partial_failure = true and all errors occur inside the operations. If any errors occur outside the operations (for example, auth errors), we return an RPC level error.
    "code": 42, # The status code, which should be an enum value of google.rpc.Code.
    "details": [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        "a_key": "", # Properties of the object. Contains field @type with type URL.
      },
    ],
    "message": "A String", # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  },
  "results": [ # All results for the mutate.
    { # The result for the shared criterion mutate.
      "resourceName": "A String", # Returned for successful operations.
      "sharedCriterion": { # A criterion belonging to a shared set. # The mutated shared criterion with only mutable fields after mutate. The field will only be returned when response_content_type is set to "MUTABLE_RESOURCE".
        "brand": { # Represents a Brand Criterion used for targeting based on commercial knowledge graph. # Immutable. Brand.
          "displayName": "A String", # Output only. A text representation of a brand.
          "entityId": "A String", # The Commercial KG MID for the brand.
          "primaryUrl": "A String", # Output only. The primary url of a brand.
          "rejectionReason": "A String", # Output only. The rejection reason when a brand status is REJECTED.
          "status": "A String", # Output only. The status of a brand.
        },
        "criterionId": "A String", # Output only. The ID of the criterion. This field is ignored for mutates.
        "keyword": { # A keyword criterion. # Immutable. Keyword.
          "matchType": "A String", # The match type of the keyword.
          "text": "A String", # The text of the keyword (at most 80 characters and 10 words).
        },
        "mobileAppCategory": { # A mobile app category criterion. # Immutable. Mobile App Category.
          "mobileAppCategoryConstant": "A String", # The mobile app category constant resource name.
        },
        "mobileApplication": { # A mobile application criterion. # Immutable. Mobile application.
          "appId": "A String", # A string that uniquely identifies a mobile application to Google Ads API. The format of this string is "{platform}-{platform_native_id}", where platform is "1" for iOS apps and "2" for Android apps, and where platform_native_id is the mobile application identifier native to the corresponding platform. For iOS, this native identifier is the 9 digit string that appears at the end of an App Store URL (for example, "476943146" for "Flood-It! 2" whose App Store link is "http://itunes.apple.com/us/app/flood-it!-2/id476943146"). For Android, this native identifier is the application's package name (for example, "com.labpixies.colordrips" for "Color Drips" given Google Play link "https://play.google.com/store/apps/details?id=com.labpixies.colordrips"). A well formed app id for Google Ads API would thus be "1-476943146" for iOS and "2-com.labpixies.colordrips" for Android. This field is required and must be set in CREATE operations.
          "name": "A String", # Name of this mobile application.
        },
        "negative": True or False, # Immutable. If true, the criterion is excluded. If false, the criterion is targeted.
        "placement": { # A placement criterion. This can be used to modify bids for sites when targeting the content network. # Immutable. Placement.
          "url": "A String", # URL of the placement. For example, "http://www.domain.com".
        },
        "resourceName": "A String", # Immutable. The resource name of the shared criterion. Shared set resource names have the form: `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}`
        "sharedSet": "A String", # Immutable. The shared set to which the shared criterion belongs.
        "type": "A String", # Output only. The type of the criterion.
        "verticalAdsItemGroupRule": { # A criterion to represent a single item group rule in Vertical Ads. # Immutable. Vertical ads item group rule.
          "cityCriterionId": "A String", # The resource name of the Geo Target Constant for the city.
          "countryCriterionId": "A String", # The resource name of the Geo Target Constant for the country.
          "hotelClass": "A String", # Integer value specifying the class rating for a hotel. Ranges from 1 to 5 stars.
          "itemCode": "A String", # The id specifying a particular Vertical Ad listing.
          "regionCriterionId": "A String", # The resource name of the Geo Target Constant for the region.
        },
        "webpage": { # Represents a criterion for targeting webpages of an advertiser's website. # Immutable. Webpage.
          "conditions": [ # Conditions, or logical expressions, for webpage targeting. The list of webpage targeting conditions are and-ed together when evaluated for targeting. An empty list of conditions indicates all pages of the campaign's website are targeted. This field is required for CREATE operations and is prohibited on UPDATE operations.
            { # Logical expression for targeting webpages of an advertiser's website.
              "argument": "A String", # Argument of webpage targeting condition.
              "operand": "A String", # Operand of webpage targeting condition.
              "operator": "A String", # Operator of webpage targeting condition.
            },
          ],
          "coveragePercentage": 3.14, # Website criteria coverage percentage. This is the computed percentage of website coverage based on the website target, negative website target and negative keywords in the ad group and campaign. For instance, when coverage returns as 1, it indicates it has 100% coverage. This field is read-only.
          "criterionName": "A String", # The name of the criterion that is defined by this parameter. The name value will be used for identifying, sorting and filtering criteria with this type of parameters. This field is required for CREATE operations and is prohibited on UPDATE operations.
          "sample": { # List of sample urls that match the website target # List of sample urls that match the website target. This field is read-only.
            "sampleUrls": [ # Webpage sample urls
              "A String",
            ],
          },
        },
        "youtubeChannel": { # A YouTube Channel criterion. # Immutable. YouTube Channel.
          "channelId": "A String", # The YouTube uploader channel id or the channel code of a YouTube channel.
        },
        "youtubeVideo": { # A YouTube Video criterion. # Immutable. YouTube Video.
          "videoId": "A String", # YouTube video id as it appears on the YouTube watch page.
        },
      },
    },
  ],
}