You can work through this quickstart to get familiar with sending event data.
Event data is an additional data source for your tag conversions, to maximize ad interaction signals and strengthen your data and overall performance.
Choose the version of the guide that you want to see:
In this quickstart, you complete the following steps:
- Prepare a
Destination
to receive event data. - Prepare event data to send.
- Build an
IngestionService
request for events. - Send the request with the Google APIs Explorer.
- Understand success and failure responses.
Prepare a destination
Before you can send data, you need to prepare the destination to send the data
to. Here's a sample Destination
for you to use:
{
"operatingAccount": {
"product": "GOOGLE_ADS",
"accountId": "OPERATING_ACCOUNT_ID"
},
"productDestinationId": "CONVERSION_ACTION_1_ID"
}
- Set the
accountId
of theoperatingAccount
to the Google Ads account ID that will receive the event data. Theproduct
of theoperatingAccount
must beGOOGLE_ADS
. Set the
productDestinationId
to the ID of the conversion action for the events. The conversion action must be a Google Ads conversion action withtype
set toWEBPAGE
.This guide shows how to construct a request that sends every event to the same conversion action. If you want to send events for multiple conversion actions in the same request, see multiple destinations.
Prepare event data
Consider the following event data. Each table corresponds to one conversion event. Each conversion event has a timestamp of the event, its conversion action, and conversion value.
Each event might have ad identifiers, like gclid
, or user identifiers, like
email addresses, phone numbers, and address information.
Here's the first event's data:
Event #1 | |
---|---|
conversion_time |
2025-06-10 15:07:01-05:00 |
conversion_action_id |
123456789 |
transaction_id |
ABC798654321 |
conversion_value |
1.99 |
currency |
USD |
gclid |
GCLID_1 |
emails |
|
given_name |
John |
family_name |
Smith-Jones |
region_code |
us |
postal_code |
94045 |
Here's the second event's data:
Event #2 | |
---|---|
conversion_time |
June 10, 2025 11:42:33PM America/New_York |
conversion_action_id |
123456789 |
transaction_id |
DEF999911111 |
conversion_value |
3.25 |
currency |
eur |
gclid |
GCLID_2 |
emails |
|
given_name |
zoë |
family_name |
pérez |
region_code |
PT |
postal_code |
1229-076 |
Format the data
Format the fields according as specified in the formatting guide. Here's the first event's data after formatting:
Event #1 | |
---|---|
conversion_time |
2025-06-10 15:07:01-05:00 |
conversion_action_id |
123456789 |
transaction_id |
ABC798654321 |
conversion_value |
1.99 |
currency |
USD |
gclid |
GCLID_1 |
emails |
|
given_name |
john |
family_name |
smith-jones |
region_code |
US |
postal_code |
94045 |
Here's the second event's data after formatting:
Event #2 | |
---|---|
conversion_time |
2025-06-10T23:42:33-05:00 |
conversion_action_id |
123456789 |
transaction_id |
DEF999911111 |
conversion_value |
3.25 |
currency |
EUR |
gclid |
GCLID_2 |
emails |
|
given_name |
zoë |
family_name |
pérez |
region_code |
PT |
postal_code |
1229-076 |
Hash and encode the data
In addition, the formatted email addresses, given names, and family names must be hashed using the SHA-256 algorithm and encoded using either hex or Base64 encoding. Here's the first event's data after formatting, hashing, and encoding using hex encoding:
Event #1 | |
---|---|
conversion_time |
2025-06-10 15:07:01-05:00 |
conversion_action_id |
123456789 |
transaction_id |
ABC798654321 |
conversion_value |
1.99 |
currency |
USD |
gclid |
GCLID_1 |
emails |
|
given_name |
96D9632F363564CC3032521409CF22A852F2032EEC099ED5967C0D000CEC607A |
family_name |
DB98D2607EFFFA28AFF66975868BF54C075ECA7157E35064DCE08E20B85B1081 |
region_code |
US |
postal_code |
94045 |
Here's the second event's data after formatting, hashing, and encoding using hex encoding:
Event #2 | |
---|---|
conversion_time |
2025-06-10T23:42:33-05:00 |
conversion_action_id |
123456789 |
transaction_id |
DEF999911111 |
conversion_value |
3.25 |
currency |
EUR |
gclid |
GCLID_2 |
emails |
|
given_name |
2752B88686847FA5C86F47B94CE652B7B3F22A91C37617D451A4DB9AFA431450 |
family_name |
6654977D57DDDD3C0329CA741B109EF6CD6430BEDD00008AAD213DF25683D77F |
region_code |
PT |
postal_code |
1229-076 |
Convert the data to an Event
Convert each event's formatted and hashed data to an Event
. Populate the
following required fields:
event_timestamp
: The time the event occurred.transaction_id
: The unique identifier for the event.event_source
: The source of the event. If specified, this must beWEB
.ad_identifiers
oruser_data
: The event must have either an ad identifier or user data. Send both if you have both for the event.
Refer to the Event
reference documentation for the complete list of
available fields. Populate any field where you have a value for the event.
Here's a sample Event
for the formatted, hashed, and encoded data from the
second event:
{
"adIdentifiers": {
"gclid": "GCLID_2"
},
"conversionValue": 3.25,
"currency": "EUR",
"eventTimestamp": "2025-06-10T23:42:33-05:00",
"transactionId": "DEF999911111",
"eventSource": "WEB",
"userData": {
"userIdentifiers": [
{
"emailAddress": "3E693CF7E5B67880BFF33B2D2626DADB7BF1D4BC737192E47CF8BAA89ACF2250"
},
{
"emailAddress": "223EBDA6F6889B1494551BA902D9D381DAF2F642BAE055888E96343D53E9F9C4"
},
{
"address": {
"givenName": "2752B88686847FA5C86F47B94CE652B7B3F22A91C37617D451A4DB9AFA431450",
"familyName": "6654977D57DDDD3C0329CA741B109EF6CD6430BEDD00008AAD213DF25683D77F",
"regionCode": "PT",
"postalCode": "1229-076"
}
}
]
}
}
Build the request body
Combine the Destination
and Events
for the request body:
{
"destinations": [
{
"operatingAccount": {
"product": "GOOGLE_ADS",
"accountId": "OPERATING_ACCOUNT_ID"
},
"productDestinationId": "CONVERSION_ACTION_1_ID"
}
],
"encoding": "HEX",
"events": [
{
"adIdentifiers": {
"gclid": "GCLID_1"
},
"conversionValue": 1.99,
"currency": "USD",
"eventTimestamp": "2025-06-10T20:07:01Z",
"transactionId": "ABC798654321",
"eventSource": "WEB",
"userData": {
"userIdentifiers": [
{
"address": {
"givenName": "96D9632F363564CC3032521409CF22A852F2032EEC099ED5967C0D000CEC607A",
"familyName": "DB98D2607EFFFA28AFF66975868BF54C075ECA7157E35064DCE08E20B85B1081",
"regionCode": "US",
"postalCode": "94045"
}
}
]
}
},
{
"adIdentifiers": {
"gclid": "GCLID_2"
},
"conversionValue": 3.25,
"currency": "EUR",
"eventTimestamp": "2025-06-11T04:42:33Z",
"transactionId": "DEF999911111",
"eventSource": "WEB",
"userData": {
"userIdentifiers": [
{
"emailAddress": "3E693CF7E5B67880BFF33B2D2626DADB7BF1D4BC737192E47CF8BAA89ACF2250"
},
{
"emailAddress": "223EBDA6F6889B1494551BA902D9D381DAF2F642BAE055888E96343D53E9F9C4"
},
{
"address": {
"givenName": "2752B88686847FA5C86F47B94CE652B7B3F22A91C37617D451A4DB9AFA431450",
"familyName": "6654977D57DDDD3C0329CA741B109EF6CD6430BEDD00008AAD213DF25683D77F",
"regionCode": "PT",
"postalCode": "1229-076"
}
}
]
}
}
],
"validateOnly": true
}
- Update the placeholders in the body, such as
OPERATING_ACCOUNT_ID
andCONVERSION_ACTION_1_ID
with the values for your account and destination. - Set
validateOnly
totrue
to validate the request without applying the changes. When you're ready to apply the changes, setvalidateOnly
tofalse
. - Note this request doesn't use encryption.
Send the request
- Copy the request body using the copy button at the top right of the sample.
- Go to the
events.ingest
page. - Click the API button on the right, then the Try it! button in the expanded section.
- Paste the copied request body into the Request body box.
- Click the Execute button, complete the authorization prompts, and review the response.
Success responses
A successful request returns a response with an object containing a requestId
.
{
"requestId": "126365e1-16d0-4c81-9de9-f362711e250a"
}
Failure responses
A failed request results in an error response status code such as 400 Bad
Request
, and a response with error details.
For example, an email_address
containing a plain text string instead of a hex
encoded value produces the following response:
{
"error": {
"code": 400,
"message": "There was a problem with the request.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "INVALID_ARGUMENT",
"domain": "datamanager.googleapis.com"
},
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "events.events[0].user_data.user_identifiers",
"description": "Email is not hex encoded.",
"reason": "INVALID_HEX_ENCODING"
}
]
}
]
}
}
An email_address
that isn't hashed and is only hex encoded produces the
following response:
{
"error": {
"code": 400,
"message": "There was a problem with the request.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "INVALID_ARGUMENT",
"domain": "datamanager.googleapis.com"
},
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "events.events[0]",
"reason": "INVALID_SHA256_FORMAT"
}
]
}
]
}
}
Send events for multiple destinations
If your data contains events for different destinations, you can send them in the same request by using destination references.
For example, if you have an event for conversion action ID 123456789
and
another event for conversion action ID 777111122
, send both events in a single
request by setting the reference
of each Destination
. The reference
is
user-defined—the only requirement is that each Destination
has a unique
reference
. Here's the modified destinations
list for the request:
"destinations": [
{
"operatingAccount": {
"product": "GOOGLE_ADS",
"accountId": "OPERATING_ACCOUNT_ID"
},
"productDestinationId": "123456789"
"reference": "conversion_action_1"
},
{
"operatingAccount": {
"product": "GOOGLE_ADS",
"accountId": "OPERATING_ACCOUNT_ID"
},
"productDestinationId": "777111122"
"reference": "conversion_action_2"
}
]
Set the destination_references
of each Event
to send it to one or more
specific destinations. For example, here's an Event
that's only for the first
Destination
, so its destination_references
list only contains the
reference
of the first Destination
:
{
"adIdentifiers": {
"gclid": "GCLID_1"
},
"conversionValue": 1.99,
"currency": "USD",
"eventTimestamp": "2025-06-10T20:07:01Z",
"transactionId": "ABC798654321",
"eventSource": "WEB",
"destinationReferences": [
"conversion_action_1"
]
}
The destination_references
field is a list, so you can specify multiple
destinations for an event. If you don't set the destination_references
of an
Event
, the Data Manager API sends the event to all of the destinations in the
request.
Next steps
- Configure authentication and setup your environment with a client library.
- Learn about the formatting, hashing, and encoding requirements for each type of data.
Learn how to encrypt user data.
Learn about best practices.
Learn about limits and quotas.