Close httplib2 connections.
ingest(body=None, x__xgafv=None)
Uploads a list of AdEvent resources to Google Analytics. This feature is only available to accounts on an allowlist.
close()
Close httplib2 connections.
ingest(body=None, x__xgafv=None)
Uploads a list of AdEvent resources to Google Analytics. This feature is only available to accounts on an allowlist.
Args:
body: object, The request body.
The object takes the form of:
{ # Request to upload ad events.
"adEvents": [ # Required. Required (at least 1). A list of ad events.
{ # An ad event.
"adFormat": "A String", # Enum value for ad format.
"adFormatString": "A String", # String value for ad format.
"adGroupId": "A String", # Optional. The ID of the associated ad group.
"adHeight": 42, # Optional. The height of the ad in pixels.
"adId": "A String", # Optional. The ID of the associated ad within the group.
"adPlacement": "A String", # Enum value for ad placement.
"adPlacementString": "A String", # String value for ad placement.
"adType": "A String", # Enum value for ad type.
"adTypeString": "A String", # String value for ad type.
"adWidth": 42, # Optional. The width of the ad in pixels.
"advertiserId": "A String", # Required. The ID of the advertiser for the ad event. This must match the ID sent in the linking flow.
"attributionHint": "A String", # Optional. The partner-assumed attribution status for this ad event. This acts only as a signal for how the partner assumed attribution played out, and does not force an end result in final reports.
"campaignId": "A String", # Required. The ID of the associated campaign.
"campaignName": "A String", # Required. The name of the associated campaign.
"deviceInfo": { # Information about the device being used (if any) when the event happened. # Optional. Information gathered about the device being used when the ad event happened.
"brand": "A String", # Optional. The brand of the device.
"browser": "A String", # Optional. The brand or type of the browser.
"browserVersion": "A String", # Optional. The version of the browser.
"category": "A String", # Optional. The category of device. For example, “desktop”, “tablet”, “mobile”, “smart TV”.
"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.
"languageCode": "A String", # Optional. The language the device uses in ISO 639-1 format.
"model": "A String", # Optional. The model of the device.
"operatingSystem": "A String", # Optional. The operating system or platform of the device.
"operatingSystemVersion": "A String", # Optional. The version of the operating system or platform.
"screenHeight": 42, # Optional. The height of the screen in pixels.
"screenWidth": 42, # Optional. The width of the screen in pixels.
"userAgent": "A String", # Optional. The user-agent string of the device for the given context.
},
"eventId": "A String", # Optional. An ID created and managed by the caller that uniquely identifies this event. Required if you want to deduplicate ad events that are included in multiple requests. Otherwise, this field is optional.
"eventSubtype": "A String", # Enum value for event subtype.
"eventSubtypeString": "A String", # String value for event subtype.
"eventType": "A String", # Required. The type of the event.
"measurementAllowed": True or False, # Optional. Represents if the row is allowed to be used for measurement purposes, as governed by applicable privacy laws within regional jurisdiction.
"medium": "A String", # Required. The medium of the ad, akin to the Google Analytics medium.
"mobileDeviceId": "A String", # Optional. The device ID of the device that the ad was served to.
"platform": "A String", # Enum value for platform.
"platformString": "A String", # String value for platform.
"platformType": "A String", # Enum value for platform type.
"platformTypeString": "A String", # String value for platform type.
"regionCode": "A String", # Required. The ISO 3166-2 country plus subdivision.
"source": "A String", # Required. The platform source of the ad, akin to the Google Analytics source.
"targetingType": "A String", # Enum value for targeting type.
"targetingTypeString": "A String", # String value for targeting type.
"timestamp": "A String", # Required. The time the event occurred.
"userData": { # Data that identifies the user. At least one identifier is required. # Optional. Multiple pieces of user-provided data, representing the user the event is associated with. It is possible to provide multiple instances of the same type of data (e.g. email address). The more data provided, the more likely a match will be found.
"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).
},
],
},
"viewabilityInfo": { # Details of the viewability of the ad served. # Required. Details of the viewability of the ad served.
"mediaDuration": "A String", # Optional. The duration of the ad media.
"mediaQuartile": "A String", # Optional. The amount of the media that was played as discrete quartiles.
"mediaSkippable": True or False, # Optional. Whether the ad media was skippable or not.
"mediaVolumePercent": 42, # Optional. The numerical percent (0-100) of the volume of the media playback.
"playbackDuration": "A String", # Optional. The duration of playback of the ad media, regardless of whether it was viewable or not.
"viewType": "A String", # Required. The type of the event.
"viewableDuration": "A String", # Optional. The amount of time the ad was viewable for.
"viewablePercent": 42, # Optional. The numerical percent (0-100) of the pixels that were viewable.
},
},
],
"encryptionInfo": { # Encryption information for the data being ingested. # Optional. Information about encryption keys which are used to encrypt the data.
"awsWrappedKeyInfo": { # A data encryption key wrapped by an AWS KMS key. # Amazon Web Services wrapped key information.
"encryptedDek": "A String", # Required. The base64 encoded encrypted data encryption key.
"kekUri": "A String", # Required. The URI of the AWS KMS key used to decrypt the DEK. Should be in the format of `arn:{partition}:kms:{region}:{account_id}:key/{key_id}` or `aws-kms://arn:{partition}:kms:{region}:{account_id}:key/{key_id}`
"keyType": "A String", # Required. The type of algorithm used to encrypt the data.
"roleArn": "A String", # Required. The Amazon Resource Name of the IAM Role to assume for KMS decryption access. Should be in the format of `arn:{partition}:iam::{account_id}:role/{role_name}`
},
"coordinatorKeyInfo": { # Information about the coordinator key. # Key information for the chosen coordinator key. This is not supported for the IngestEvents, IngestAudienceMembers, and RemoveAudienceMembers methods.
"keyId": "A String", # Required. The ID of the chosen coordinator key.
},
"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}` or `gcp-kms://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.
},
},
"validateOnly": True or False, # Optional. If true, the request is validated, but not executed.
}
x__xgafv: string, V1 error format.
Allowed values
1 - v1 error format
2 - v2 error format
Returns:
An object of the form:
{ # Response from an ad event ingestion operation.
}