Close httplib2 connections.
ingest(body=None, x__xgafv=None)
Uploads a list of Event resources from the provided Destination.
close()
Close httplib2 connections.
ingest(body=None, x__xgafv=None)
Uploads a list of Event resources from the provided Destination. Args: body: object, The request body. The object takes the form of: { # Request to upload audience members to the provided destinations. Returns an IngestEventsResponse. "consent": { # [Digital Markets Act (DMA)](//digital-markets-act.ec.europa.eu/index_en) consent settings for the user. # Optional. Request-level consent to apply to all users in the request. User-level consent overrides request-level consent, and can be specified in each Event. "adPersonalization": "A String", # Optional. Represents if the user consents to ad personalization. "adUserData": "A String", # Optional. Represents if the user consents to ad user data. }, "destinations": [ # Required. The list of destinations to send the events to. { # The Google product you're sending data to. For example, a Google Ads account. "linkedAccount": { # Represents a specific account. # Optional. An account that the calling user's `login_account` has access to, through an established account link. For example, a data partner's `login_account` might have access to a client's `linked_account`. The partner might use this field to send data from the `linked_account` to another `operating_account`. "accountId": "A String", # Required. The ID of the account. For example, your Google Ads account ID. "accountType": "A String", # Optional. The type of the account. For example, `GOOGLE_ADS`. Either `account_type` or the deprecated `product` is required. If both are set, the values must match. "product": "A String", # Deprecated. Use `account_type` instead. }, "loginAccount": { # Represents a specific account. # Optional. The account used to make this API call. To add or remove data from the `operating_account`, this `login_account` must have write access to the `operating_account`. For example, a manager account of the `operating_account`, or an account with an established link to the `operating_account`. "accountId": "A String", # Required. The ID of the account. For example, your Google Ads account ID. "accountType": "A String", # Optional. The type of the account. For example, `GOOGLE_ADS`. Either `account_type` or the deprecated `product` is required. If both are set, the values must match. "product": "A String", # Deprecated. Use `account_type` instead. }, "operatingAccount": { # Represents a specific account. # Required. The account to send the data to or remove the data from. "accountId": "A String", # Required. The ID of the account. For example, your Google Ads account ID. "accountType": "A String", # Optional. The type of the account. For example, `GOOGLE_ADS`. Either `account_type` or the deprecated `product` is required. If both are set, the values must match. "product": "A String", # Deprecated. Use `account_type` instead. }, "productDestinationId": "A String", # Required. The object within the product account to ingest into. For example, a Google Ads audience ID, a Display & Video 360 audience ID or a Google Ads conversion action ID. "reference": "A String", # Optional. ID for this `Destination` resource, unique within the request. Use to reference this `Destination` in the IngestEventsRequest and IngestAudienceMembersRequest. }, ], "encoding": "A String", # Optional. Required for UserData uploads. The encoding type of the user identifiers. For hashed user identifiers, this is the encoding type of the hashed string. For encrypted hashed user identifiers, this is the encoding type of the outer encrypted string, but not necessarily the inner hashed string, meaning the inner hashed string could be encoded in a different way than the outer encrypted string. For non `UserData` uploads, this field is ignored. "encryptionInfo": { # Encryption information for the data being ingested. # Optional. Encryption information for UserData uploads. If not set, it's assumed that uploaded identifying information is hashed but not encrypted. For non `UserData` uploads, this field is ignored. "gcpWrappedKeyInfo": { # Information about the Google Cloud Platform wrapped key. # Google Cloud Platform wrapped key information. "encryptedDek": "A String", # Required. The base64 encoded encrypted data encryption key. "kekUri": "A String", # Required. Google Cloud Platform [Cloud Key Management Service resource ID](//cloud.google.com/kms/docs/getting-resource-ids). Should be in the format of "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{key}". "keyType": "A String", # Required. The type of algorithm used to encrypt the data. "wipProvider": "A String", # Required. The [Workload Identity](//cloud.google.com/iam/docs/workload-identity-federation) pool provider required to use KEK. }, }, "events": [ # Required. The list of events to send to the specified destinations. At most 2000 Event resources can be sent in a single request. { # An event representing a user interaction with an advertiser's website or app. "adIdentifiers": { # Identifiers and other information used to match the conversion event with other online activity (such as ad clicks). # Optional. Identifiers and other information used to match the conversion event with other online activity (such as ad clicks). "gbraid": "A String", # Optional. The click identifier for clicks associated with app events and originating from iOS devices starting with iOS14. "gclid": "A String", # Optional. The Google click ID (gclid) associated with this event. "landingPageDeviceInfo": { # Information about the device being used (if any) when the event happened. # Optional. Information gathered about the device being used (if any) at the time of landing onto the advertiser’s site after interacting with the ad. "ipAddress": "A String", # Optional. The IP address of the device for the given context. **Note:** Google Ads does not support IP address matching for end users in the European Economic Area (EEA), United Kingdom (UK), or Switzerland (CH). Add logic to conditionally exclude sharing IP addresses from users from these regions and ensure that you provide users with clear and comprehensive information about the data you collect on your sites, apps, and other properties and get consent where required by law or any applicable Google policies. See the [About offline conversion imports](https://support.google.com/google-ads/answer/2998031) page for more details. "userAgent": "A String", # Optional. The user-agent string of the device for the given context. }, "sessionAttributes": "A String", # Optional. Session attributes for event attribution and modeling. "wbraid": "A String", # Optional. The click identifier for clicks associated with web events and originating from iOS devices starting with iOS14. }, "cartData": { # The cart data associated with the event. # Optional. Information about the transaction and items associated with the event. "items": [ # Optional. The list of items associated with the event. { # Represents an item in the cart associated with the event. "merchantProductId": "A String", # Optional. The product ID within the Merchant Center account. "quantity": "A String", # Optional. The number of this item associated with the event. "unitPrice": 3.14, # Optional. The unit price excluding tax, shipping, and any transaction level discounts. }, ], "merchantFeedLabel": "A String", # Optional. The Merchant Center feed label associated with the feed of the items. "merchantFeedLanguageCode": "A String", # Optional. The language code in ISO 639-1 associated with the Merchant Center feed of the items.where your items are uploaded. "merchantId": "A String", # Optional. The Merchant Center ID associated with the items. "transactionDiscount": 3.14, # Optional. The sum of all discounts associated with the transaction. }, "consent": { # [Digital Markets Act (DMA)](//digital-markets-act.ec.europa.eu/index_en) consent settings for the user. # Optional. Information about whether the associated user has provided different types of consent. "adPersonalization": "A String", # Optional. Represents if the user consents to ad personalization. "adUserData": "A String", # Optional. Represents if the user consents to ad user data. }, "conversionValue": 3.14, # Optional. The conversion value associated with the event, for value-based conversions. "currency": "A String", # Optional. The currency code associated with all monetary values within this event. "customVariables": [ # Optional. Additional key/value pair information to send to the conversion containers (conversion action or FL activity). { # Custom variable for ads conversions. "destinationReferences": [ # Optional. Reference string used to determine which of the Event.destination_references the custom variable should be sent to. If empty, the Event.destination_references will be used. "A String", ], "value": "A String", # Optional. The value to store for the custom variable. "variable": "A String", # Optional. The name of the custom variable to set. If the variable is not found for the given destination, it will be ignored. }, ], "destinationReferences": [ # Optional. Reference string used to determine the destination. If empty, the event will be sent to all destinations in the request. "A String", ], "eventDeviceInfo": { # Information about the device being used (if any) when the event happened. # Optional. Information gathered about the device being used (if any) when the event happened. "ipAddress": "A String", # Optional. The IP address of the device for the given context. **Note:** Google Ads does not support IP address matching for end users in the European Economic Area (EEA), United Kingdom (UK), or Switzerland (CH). Add logic to conditionally exclude sharing IP addresses from users from these regions and ensure that you provide users with clear and comprehensive information about the data you collect on your sites, apps, and other properties and get consent where required by law or any applicable Google policies. See the [About offline conversion imports](https://support.google.com/google-ads/answer/2998031) page for more details. "userAgent": "A String", # Optional. The user-agent string of the device for the given context. }, "eventSource": "A String", # Optional. Signal for where the event happened (web, app, in-store, etc.). "eventTimestamp": "A String", # Required. The time the event occurred. "experimentalFields": [ # Optional. A list of key/value pairs for experimental fields that may eventually be promoted to be part of the API. { # Experimental field representing unofficial fields. "field": "A String", # Optional. The name of the field to use. "value": "A String", # Optional. The value the field to set. }, ], "lastUpdatedTimestamp": "A String", # Optional. The last time the event was updated. "transactionId": "A String", # Optional. The unique identifier for this event. Required for conversions using multiple data sources. "userData": { # Data that identifies the user. At least one identifier is required. # Optional. Pieces of user provided data, representing the user the event is associated with. "userIdentifiers": [ # Required. The identifiers for the user. It's possible to provide multiple instances of the same type of data (for example, multiple email addresses). To increase the likelihood of a match, provide as many identifiers as possible. At most 10 `userIdentifiers` can be provided in a single AudienceMember or Event. { # A single identifier for the user. "address": { # Address information for the user. # The known components of a user's address. Holds a grouping of identifiers that are matched all at once. "familyName": "A String", # Required. Family (last) name of the user, all lowercase, with no punctuation, no leading or trailing whitespace, and hashed as SHA-256. "givenName": "A String", # Required. Given (first) name of the user, all lowercase, with no punctuation, no leading or trailing whitespace, and hashed as SHA-256. "postalCode": "A String", # Required. The postal code of the user's address. "regionCode": "A String", # Required. The 2-letter region code in ISO-3166-1 alpha-2 of the user's address. }, "emailAddress": "A String", # Hashed email address using SHA-256 hash function after normalization. "phoneNumber": "A String", # Hashed phone number using SHA-256 hash function after normalization (E164 standard). }, ], }, "userProperties": { # Advertiser-assessed information about the user at the time that the event happened. See https://support.google.com/google-ads/answer/14007601 for more details. # Optional. Advertiser-assessed information about the user at the time that the event happened. "customerType": "A String", # Optional. Type of the customer associated with the event. "customerValueBucket": "A String", # Optional. The advertiser-assessed value of the customer. }, }, ], "validateOnly": True or False, # Optional. For testing purposes. 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 from the IngestEventsRequest. "requestId": "A String", # The auto-generated ID of the request. }