- HTTP request
- Request body
- Response body
- Authorization scopes
- AdEvent
- EventType
- EventSubtype
- AdType
- AdFormat
- AdPlacement
- TargetingType
- PlatformType
- Platform
- AttributionHint
- ViewabilityInfo
- ViewType
- MediaQuartile
- Try it!
Uploads a list of AdEvent resources to Google Analytics.
This feature is only available to accounts on an allowlist.
HTTP request
POST https://datamanager.googleapis.com/v1/adEvents:ingest
The URL uses gRPC Transcoding syntax.
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "adEvents": [ { object ( |
| Fields | |
|---|---|
adEvents[] |
Required. Required (at least 1). A list of ad events. |
encryptionInfo |
Optional. Information about encryption keys which are used to encrypt the data. |
validateOnly |
Optional. If true, the request is validated, but not executed. |
Response body
If successful, the response body is empty.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/datamanager
AdEvent
An ad event.
| JSON representation |
|---|
{ "advertiserId": string, "eventType": enum ( |
| Fields | |
|---|---|
advertiserId |
Required. The ID of the advertiser for the ad event. This must match the ID sent in the linking flow. |
eventType |
Required. The type of the event. |
timestamp |
Required. The time the event occurred. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
eventId |
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. |
userData |
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. |
deviceInfo |
Optional. Information gathered about the device being used when the ad event happened. |
mobileDeviceId |
Optional. The device ID of the device that the ad was served to. |
campaignId |
Required. The ID of the associated campaign. |
campaignName |
Required. The name of the associated campaign. |
adGroupId |
Optional. The ID of the associated ad group. |
adId |
Optional. The ID of the associated ad within the group. |
adHeight |
Optional. The height of the ad in pixels. |
adWidth |
Optional. The width of the ad in pixels. |
regionCode |
Required. The ISO 3166-2 country plus subdivision. |
source |
Required. The platform source of the ad, akin to the Google Analytics source. |
medium |
Required. The medium of the ad, akin to the Google Analytics medium. |
attributionHint |
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. |
viewabilityInfo |
Required. Details of the viewability of the ad served. |
Union field A raw string is accepted to handle values other than the pure enums. The enum is preferred if possible. |
|
eventSubtype |
Enum value for event subtype. |
eventSubtypeString |
String value for event subtype. |
Union field A raw string is accepted to handle values other than the pure enums. The enum is preferred if possible. |
|
adType |
Enum value for ad type. |
adTypeString |
String value for ad type. |
Union field A raw string is accepted to handle values other than the pure enums. The enum is preferred if possible. |
|
adFormat |
Enum value for ad format. |
adFormatString |
String value for ad format. |
Union field A raw string is accepted to handle values other than the pure enums. The enum is preferred if possible. |
|
adPlacement |
Enum value for ad placement. |
adPlacementString |
String value for ad placement. |
Union field A raw string is accepted to handle values other than the pure enums. The enum is preferred if possible. |
|
targetingType |
Enum value for targeting type. |
targetingTypeString |
String value for targeting type. |
Union field A raw string is accepted to handle values other than the pure enums. The enum is preferred if possible. |
|
platformType |
Enum value for platform type. |
platformTypeString |
String value for platform type. |
Union field A raw string is accepted to handle values other than the pure enums. The enum is preferred if possible. |
|
platform |
Enum value for platform. |
platformString |
String value for platform. |
measurementAllowed |
Optional. Represents if the row is allowed to be used for measurement purposes, as governed by applicable privacy laws within regional jurisdiction. |
EventType
The type of the event.
| Enums | |
|---|---|
EVENT_TYPE_UNSPECIFIED |
Unspecified event type. |
EVENT_TYPE_VIEW |
View event. |
EVENT_TYPE_CLICK |
Click event. |
EventSubtype
Additional classification about the type of ad event.
| Enums | |
|---|---|
EVENT_SUBTYPE_UNSPECIFIED |
Unspecified event subtype. |
EVENT_SUBTYPE_IMPRESSION |
Impression event. |
EVENT_SUBTYPE_ENGAGED_VIEW |
Engaged view event. |
EVENT_SUBTYPE_ONSITE_CLICK |
Onsite click event. |
EVENT_SUBTYPE_OUTBOUND_CLICK |
Outbound click event. |
AdType
The type of the ad served.
| Enums | |
|---|---|
AD_TYPE_UNSPECIFIED |
Unspecified ad type. |
AD_TYPE_DISPLAY |
Display ad. |
AD_TYPE_TEXT |
Text ad. |
AD_TYPE_IMAGE |
Image ad. |
AD_TYPE_RICH_MEDIA |
Rich media ad. |
AD_TYPE_HTML |
HTML ad. |
AD_TYPE_AUDIO |
Audio ad. |
AD_TYPE_VIDEO |
Video ad. |
AdFormat
The format of the ad served.
| Enums | |
|---|---|
AD_FORMAT_UNSPECIFIED |
Unspecified ad format. |
AD_FORMAT_AR |
AR ad. |
AD_FORMAT_AUDIO |
Audio ad. |
AD_FORMAT_BANNER |
Banner ad. |
AD_FORMAT_BUMPER |
Bumper ad. |
AD_FORMAT_CAROUSEL |
Carousel ad. |
AD_FORMAT_COLLECTION |
Collection ad. |
AD_FORMAT_IMAGE |
Image ad. |
AD_FORMAT_INTERACTIVE |
Interactive ad. |
AD_FORMAT_INTERSTITIAL |
Interstitial ad. |
AD_FORMAT_IN_FEED |
In-feed ad. |
AD_FORMAT_IN_STREAM |
In-stream ad. |
AD_FORMAT_IN_STREAM_SKIPPABLE |
In-stream skippable ad. |
AD_FORMAT_IN_STREAM_NON_SKIPPABLE |
In-stream non-skippable ad. |
AD_FORMAT_NATIVE |
Native ad. |
AD_FORMAT_SHORTS |
Shorts ad. |
AD_FORMAT_STORY |
Story ad. |
AD_FORMAT_SPONSORED |
Sponsored ad. |
AD_FORMAT_VIDEO |
Video ad. |
AdPlacement
The placement of the ad served.
| Enums | |
|---|---|
AD_PLACEMENT_UNSPECIFIED |
Unspecified ad placement. |
AD_PLACEMENT_DISCOVER |
Discover placement. |
AD_PLACEMENT_FEED |
Feed placement. |
AD_PLACEMENT_FOOTER |
Footer placement. |
AD_PLACEMENT_HEADER |
Header placement. |
AD_PLACEMENT_HOME |
Home placement. |
AD_PLACEMENT_IN_CONTENT |
In-content placement. |
AD_PLACEMENT_PROMOTED |
Promoted placement. |
AD_PLACEMENT_SEARCH |
Search placement. |
AD_PLACEMENT_STORY |
Story placement. |
TargetingType
The type of targeting used to serve the ad.
| Enums | |
|---|---|
TARGETING_TYPE_UNSPECIFIED |
Unspecified targeting type. |
TARGETING_TYPE_AUDIENCE |
Audience targeting. |
TARGETING_TYPE_CONTEXTUAL |
Contextual targeting. |
TARGETING_TYPE_DEMOGRAPHIC |
Demographic targeting. |
TARGETING_TYPE_DEVICE |
Device targeting. |
TARGETING_TYPE_GEO |
Geo targeting. |
TARGETING_TYPE_INTEREST |
Interest targeting. |
TARGETING_TYPE_PURCHASE_INTENT |
Purchase intent targeting. |
TARGETING_TYPE_REMARKETING |
Remarketing targeting. |
PlatformType
The type of the platform on which the ad was served.
| Enums | |
|---|---|
PLATFORM_TYPE_UNSPECIFIED |
Unspecified platform type. |
PLATFORM_TYPE_MOBILE |
Mobile platform. |
PLATFORM_TYPE_DESKTOP |
Desktop platform. |
PLATFORM_TYPE_CTV |
CTV platform. |
PLATFORM_TYPE_PHONE |
Phone platform. |
PLATFORM_TYPE_TABLET |
Tablet platform. |
Platform
Further detail of the platform on which the ad was served.
| Enums | |
|---|---|
PLATFORM_UNSPECIFIED |
Unspecified platform. |
PLATFORM_IOS |
iOS platform. |
PLATFORM_ANDROID |
Android platform. |
PLATFORM_WEB |
Web platform. |
AttributionHint
The partner-assumed attribution status for this ad event.
| Enums | |
|---|---|
ATTRIBUTION_HINT_UNSPECIFIED |
Unknown attribution status. |
ATTRIBUTION_HINT_CONVERTED |
Converted status. |
ATTRIBUTION_HINT_NOT_CONVERTED |
Not converted status. |
ViewabilityInfo
Details of the viewability of the ad served.
| JSON representation |
|---|
{ "viewType": enum ( |
| Fields | |
|---|---|
viewType |
Required. The type of the event. |
viewablePercent |
Optional. The numerical percent (0-100) of the pixels that were viewable. |
viewableDuration |
Optional. The amount of time the ad was viewable for. A duration in seconds with up to nine fractional digits, ending with ' |
mediaSkippable |
Optional. Whether the ad media was skippable or not. |
mediaQuartile |
Optional. The amount of the media that was played as discrete quartiles. |
mediaDuration |
Optional. The duration of the ad media. A duration in seconds with up to nine fractional digits, ending with ' |
mediaVolumePercent |
Optional. The numerical percent (0-100) of the volume of the media playback. |
playbackDuration |
Optional. The duration of playback of the ad media, regardless of whether it was viewable or not. A duration in seconds with up to nine fractional digits, ending with ' |
ViewType
The type of the event.
| Enums | |
|---|---|
VIEW_TYPE_UNSPECIFIED |
Unspecified view type. |
VIEW_TYPE_MRC_VIEWED |
MRC viewed. |
VIEW_TYPE_MRC_RENDERED |
MRC rendered. |
MediaQuartile
The amount of the media that was played as discrete quartiles.
| Enums | |
|---|---|
MEDIA_QUARTILE_UNSPECIFIED |
Unspecified media quartile. |
MEDIA_QUARTILE_START |
Start. |
MEDIA_QUARTILE_FIRST_QUARTILE |
First quartile. |
MEDIA_QUARTILE_MIDPOINT |
Midpoint. |
MEDIA_QUARTILE_THIRD_QUARTILE |
Third quartile. |
MEDIA_QUARTILE_COMPLETE |
Complete. |