You can work through this quickstart to get familiar with sending event data.

Use the Data Manager API for either of the following scenarios:

- **Online events**: Send event data as

  an additional data source for your tag conversions, to maximize ad interaction
  signals and strengthen your data and overall performance.

- **Offline events** : Send event data for [offline
  conversions](https://support.google.com/google-ads/answer/2998031) or [enhanced
  conversions for leads](https://support.google.com/google-ads/answer/15713840).

| **Note:** Data from the additional data source you connect won't flow to your conversion bidding for a 14-day trial period. This doesn't apply to your existing Google tag data source.

Choose the version of the guide that you want to see:

Advertiser Data Partner

In this quickstart, you complete the following steps:

1. Prepare a [`Destination`](https://developers.google.com/data-manager/api/reference/rest/v1/Destination) to receive event data.
2. Prepare event data to send.
3. Build an [`IngestionService`](https://developers.google.com/data-manager/api/reference/rest/v1/events/ingest) request for events.
4. Send the request with the Google APIs Explorer.
5. 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": "<var class="readonly" scope="OPERATING_ACCOUNT_PRODUCT" translate="no">GOOGLE_ADS</var>",
            "accountId": "<var translate="no">OPERATING_ACCOUNT_ID</var>"
          },

          "productDestinationId": "<var translate="no">CONVERSION_ACTION_1_ID</var>"
        }

- Set the `accountId` of the `operatingAccount` to the Google Ads account ID that will receive the event data. The `product` of the `operatingAccount` must be `GOOGLE_ADS`.
- Set the `productDestinationId` to the ID of the conversion action for
  the events. For *online events* , the conversion action must be a Google
  Ads conversion action with
  [`type`](https://developers.google.com/google-ads/api/reference/rpc/latest/ConversionAction#type)
  set to `WEBPAGE`. For *offline events* , the conversion action must be a
  Google Ads conversion action with
  [`type`](https://developers.google.com/google-ads/api/reference/rpc/latest/ConversionAction#type)
  set to `UPLOAD_CLICKS`.

  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](https://developers.google.com/data-manager/api/get-started/quickstart/send-events#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](https://developers.google.com/data-manager/api/reference/rest/v1/UserData#addressinfo). An event can also
have [information about the user assessed at the time of the
event](https://support.google.com/google-ads/answer/14007601), like the value of the
customer or whether they are a new, returning, or reengaged customer.

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`                     |
| `customer_type`         | `NEW`                       |
| `customer_value_bucket` | `HIGH`                      |

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`               | `zoe@EXAMPLE.COM` `cloudy.sanfrancisco@gmail.com` |
| `given_name`           | `zoë`                                             |
| `family_name`          | `pérez`                                           |
| `region_code`          | `PT`                                              |
| `postal_code`          | `1229-076`                                        |
| `customer_type`        | `RETURNING`                                       |

### Format the data

Format the fields according as specified in the [formatting
guide](https://developers.google.com/data-manager/api/get-started/formatting). 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`                     |
| `customer_type`         | `NEW`                       |
| `customer_value_bucket` | `HIGH`                      |

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`               | `zoe@example.com` `cloudysanfrancisco@gmail.com` |
| `given_name`           | `zoë`                                            |
| `family_name`          | `pérez`                                          |
| `region_code`          | `PT`                                             |
| `postal_code`          | `1229-076`                                       |
| `customer_type`        | `RETURNING`                                      |

### Hash and encode the data

In addition, the formatted email addresses, given names, and family names must
be hashed using the [SHA-256 algorithm](https://en.wikipedia.org/wiki/SHA-2) 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`                                                            |
| `customer_type`         | `NEW`                                                              |
| `customer_value_bucket` | `HIGH`                                                             |

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`               | `3E693CF7E5B67880BFF33B2D2626DADB7BF1D4BC737192E47CF8BAA89ACF2250` `223EBDA6F6889B1494551BA902D9D381DAF2F642BAE055888E96343D53E9F9C4` |
| `given_name`           | `2752B88686847FA5C86F47B94CE652B7B3F22A91C37617D451A4DB9AFA431450`                                                                    |
| `family_name`          | `6654977D57DDDD3C0329CA741B109EF6CD6430BEDD00008AAD213DF25683D77F`                                                                    |
| `region_code`          | `PT`                                                                                                                                  |
| `postal_code`          | `1229-076`                                                                                                                            |
| `customer_type`        | `RETURNING`                                                                                                                           |

### Convert the data to an `Event`

Convert each event's formatted and hashed data to an [`Event`](https://developers.google.com/data-manager/api/reference/rest/v1/events/ingest#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. Required for *offline events* . Optional for *online events* . If specified for an online event, must be `WEB`.
- `ad_identifiers` or `user_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`](https://developers.google.com/data-manager/api/reference/rest/v1/events/ingest#event) reference documentation for the complete list of
available fields. Populate any field where you have a value for the event.
| **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.

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"
                }
             }
          ],
          "userProperties": {
            "customerType": "RETURNING"
          }
       }
    }

## Build the request body

Combine the `Destination` and `Events` for the request body:  

    {
      "destinations": [
        {
          "operatingAccount": {
            "product": "<var class="readonly" scope="OPERATING_ACCOUNT_PRODUCT" translate="no">GOOGLE_ADS</var>",
            "accountId": "<var translate="no">OPERATING_ACCOUNT_ID</var>"
          },

          "productDestinationId": "<var translate="no">CONVERSION_ACTION_1_ID</var>"
        }
      ],
      "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"
                 }
               }
             ]
           },
           "userProperties": {
             "customerType": "NEW",
             "customerValueBucket": "HIGH"
           }
         },
         {
           "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"
                 }
               }
             ]
           },
           "userProperties": {
             "customerType": "RETURNING"
           }
         }
      ],
      "validateOnly": true
    }

1. Update the placeholders in the body, such as <var translate="no">OPERATING_ACCOUNT_ID</var> and <var translate="no">CONVERSION_ACTION_1_ID</var> with the values for your account and destination.
2. Set `validateOnly` to `true` to validate the request without applying the changes. When you're ready to apply the changes, set `validateOnly` to `false`.
3. Note this example doesn't use [encryption](https://developers.google.com/data-manager/api/get-started/encryption).

## Send the request

1. Copy the request body using the copy button at the top right of the sample.
2. Click the **API** button in the toolbar.
3. Paste the copied request body into the **Request body** box.
4. 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": "<var class="readonly" scope="OPERATING_ACCOUNT_PRODUCT" translate="no">GOOGLE_ADS</var>",
            "accountId": "<var translate="no">OPERATING_ACCOUNT_ID</var>"
          },

          "productDestinationId": "123456789"
          "reference": "conversion_action_1"
        },
        {
          "operatingAccount": {
            "product": "<var class="readonly" scope="OPERATING_ACCOUNT_PRODUCT" translate="no">GOOGLE_ADS</var>",
            "accountId": "<var translate="no">OPERATING_ACCOUNT_ID</var>"
          },

          "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](https://developers.google.com/data-manager/api/get-started/set-up-access) authentication and setup your environment with a client library.
- Learn about the [formatting, hashing, and encoding requirements](https://developers.google.com/data-manager/api/get-started/formatting) for each type of data.
- Learn how to [encrypt user data](https://developers.google.com/data-manager/api/get-started/encryption).
- Learn about [best practices](https://developers.google.com/data-manager/api/get-started/best-practices).
- Learn about [limits and quotas](https://developers.google.com/data-manager/api/limits).