You can work through this quickstart to get familiar with sending event data.
Use the Data Manager API for either of the following scenarios:
Отправляйте данные о конверсиях из тегов Google Ads или ключевые события Google Analytics в качестве дополнительного источника данных для анализа конверсий из тегов, чтобы максимизировать сигналы взаимодействия с объявлениями и улучшить качество данных и общую эффективность.
This feature is only available to accounts an allowlist. Fill out the form if you're interested in adding your Google Ads account or Google Analytics property.
Send event data for Google Ads offline conversions or enhanced conversions for leads .
Choose the version of the guide that you want to see:
In this quickstart, you complete the following steps:
- Подготовьте
Destinationдля получения данных о событиях. - Подготовьте данные события для отправки.
- Создайте запрос
IngestionServiceдля получения событий. - Отправьте запрос с помощью Google APIs Explorer.
- Разберитесь в реакциях на успех и неудачу.
Prepare destinations
Before you can send data, you need to prepare at least one Destination for the data. Here's a sample Destination for you to use:
{
"operatingAccount": {
"accountType": "OPERATING_ACCOUNT_TYPE",
"accountId": "OPERATING_ACCOUNT_ID"
},
"loginAccount": {
"accountType": "LOGIN_ACCOUNT_TYPE",
"accountId": "LOGIN_ACCOUNT_ID"
},
"productDestinationId": "PRODUCT_DESTINATION_ID"
}
Here are the fields of a Destination . Check out Configure destinations for more details and examples of destinations for different scenarios.
-
operatingAccount Учетная запись, получающая события.
For events sent as an additional data source, the operating account can be either a Google Ads account or a Google Analytics property.
If the
accountTypeisGOOGLE_ANALYTICS_PROPERTY, the request's credentials must be for a Google Analytics user with the Editor or Administrator role for the property.For offline conversions and enhanced conversions for leads, the operating account must be a Google Ads account.
-
loginAccount - The account where the Google Account for the credentials is a user.
-
productDestinationId The ID of the entity in the
operatingAccountthat receives the events.For events sent as an additional data source, the
productDestinationIdmust be one of the following:The ID of a Google Ads conversion with
typeset toWEBPAGE. In the Google Ads UI, the Conversion source for aWEBPAGEconversion action is Website .The measurement ID of a Google Analytics Web stream. You can't send events as an additional data source to a Google Analytics iOS app or Android app stream.
Для офлайн-конверсий или расширенных конверсий для лидов,
productDestinationIdдолжен быть идентификатором действия конверсии Google Ads сtypeUPLOAD_CLICKS. В пользовательском интерфейсе Google Ads источником конверсии для действия конверсииUPLOAD_CLICKSявляется веб-сайт (импорт из кликов) .
В примере, приведенном в этом руководстве, показано, как составить запрос, который отправляет все события в один и тот же пункт назначения. Если вы хотите отправлять события в несколько пунктов назначения в одном запросе, см. раздел «Отправка событий в несколько пунктов назначения» .
Подготовка данных о событии
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 . An event can also have:
- Information about the user assessed at the time of the event , like the value of the customer or whether they are a new, returning, or reengaged customer.
- Данные корзины покупок.
- Additional event parameters or user properties for a destination, such as
client_idoruser_idfor Google Analytics.
Вот данные о мероприятии:
Событие 1
| Событие №1 | |
|---|---|
conversion_time | 2025-06-10 15:07:01-05:00 |
conversion_action_id | 123456789 |
transaction_id | ABC798654321 |
conversion_value | 30.03 |
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 |
client_id | 1234567890.1761581763 |
user_id | user_ABC12345 |
ad_unit_name | Banner_01 |
event_name | purchase |
| Товары в корзине | |
item_id | SKU_12345 |
item_name | Stan and Friends Tee |
item_affiliation | Google Merchandise Store |
item_coupon | SUMMER_FUN |
item_discount | 2.22 |
item_index | 0 |
item_brand | Google |
item_category | Apparel |
item_category2 | Adult |
item_category3 | Shirts |
item_category4 | Crew |
item_category5 | Short sleeve |
item_list_id | related_products |
item_list_name | Related Products |
item_price | 10.01 |
item_quantity | 3 |
Событие 2
| Событие №2 | |
|---|---|
conversion_time | June 10, 2025 11:42:33PM America/New_York |
conversion_action_id | 123456789 |
transaction_id | DEF999911111 |
conversion_value | 42.02 |
currency | eur |
gclid | GCLID_2 |
emails | |
given_name | zoë |
family_name | pérez |
region_code | PT |
postal_code | 1229-076 |
customer_type | RETURNING |
client_id | 9876543210.1761582117 |
user_id | user_DEF9876 |
ad_unit_name | Banner_02 |
event_name | purchase |
| Товары в корзине | |
item_id | SKU_12346 |
item_name | Google Grey Women's Tee |
item_affiliation | Google Merchandise Store |
item_coupon | SUMMER_FUN |
item_discount | 3.33 |
item_index | 1 |
item_brand | Google |
item_category | Apparel |
item_category2 | Adult |
item_category3 | Shirts |
item_category4 | Crew |
item_category5 | Short sleeve |
item_list_id | related_products |
item_list_name | Related Products |
item_price | 21.01 |
item_quantity | 2 |
Отформатируйте данные
Format the fields according as specified in the formatting guide . Here's the event data after formatting:
Событие 1
| Событие №1 | |
|---|---|
conversion_time | 2025-06-10T15:07:01-05:00 |
conversion_action_id | 123456789 |
transaction_id | ABC798654321 |
conversion_value | 30.03 |
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 |
client_id | 1234567890.1761581763 |
user_id | user_ABC12345 |
ad_unit_name | Banner_01 |
event_name | purchase |
| Товары в корзине | |
item_id | SKU_12345 |
item_name | Stan and Friends Tee |
item_affiliation | Google Merchandise Store |
item_coupon | SUMMER_FUN |
item_discount | 2.22 |
item_index | 0 |
item_brand | Google |
item_category | Apparel |
item_category2 | Adult |
item_category3 | Shirts |
item_category4 | Crew |
item_category5 | Short sleeve |
item_list_id | related_products |
item_list_name | Related Products |
item_price | 10.01 |
item_quantity | 3 |
Событие 2
| Событие №2 | |
|---|---|
conversion_time | 2025-06-10T23:42:33-05:00 |
conversion_action_id | 123456789 |
transaction_id | DEF999911111 |
conversion_value | 42.02 |
currency | EUR |
gclid | GCLID_2 |
emails | |
given_name | zoë |
family_name | pérez |
region_code | PT |
postal_code | 1229-076 |
customer_type | RETURNING |
client_id | 9876543210.1761582117 |
user_id | user_DEF9876 |
ad_unit_name | Banner_02 |
event_name | purchase |
| Товары в корзине | |
item_id | SKU_12346 |
item_name | Google Grey Women's Tee |
item_affiliation | Google Merchandise Store |
item_coupon | SUMMER_FUN |
item_discount | 3.33 |
item_index | 1 |
item_brand | Google |
item_category | Apparel |
item_category2 | Adult |
item_category3 | Shirts |
item_category4 | Crew |
item_category5 | Short sleeve |
item_list_id | related_products |
item_list_name | Related Products |
item_price | 21.01 |
item_quantity | 2 |
Хэшируйте и закодируйте данные.
Кроме того, отформатированные адреса электронной почты, имена и фамилии должны быть хешированы с использованием алгоритма SHA-256 и закодированы с использованием шестнадцатеричного или Base64-кодирования. Вот данные события после форматирования, хеширования и кодирования с использованием шестнадцатеричного кодирования:
Событие 1
| Событие №1 | |
|---|---|
conversion_time | 2025-06-10T15:07:01-05:00 |
conversion_action_id | 123456789 |
transaction_id | ABC798654321 |
conversion_value | 30.03 |
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 |
client_id | 1234567890.1761581763 |
user_id | user_ABC12345 |
ad_unit_name | Banner_01 |
event_name | purchase |
| Товары в корзине | |
item_id | SKU_12345 |
item_name | Stan and Friends Tee |
item_affiliation | Google Merchandise Store |
item_coupon | SUMMER_FUN |
item_discount | 2.22 |
item_index | 0 |
item_brand | Google |
item_category | Apparel |
item_category2 | Adult |
item_category3 | Shirts |
item_category4 | Crew |
item_category5 | Short sleeve |
item_list_id | related_products |
item_list_name | Related Products |
item_price | 10.01 |
item_quantity | 3 |
Событие 2
| Событие №2 | |
|---|---|
conversion_time | 2025-06-10T23:42:33-05:00 |
conversion_action_id | 123456789 |
transaction_id | DEF999911111 |
conversion_value | 42.02 |
currency | EUR |
gclid | GCLID_2 |
emails | |
given_name | 2752B88686847FA5C86F47B94CE652B7B3F22A91C37617D451A4DB9AFA431450 |
family_name | 6654977D57DDDD3C0329CA741B109EF6CD6430BEDD00008AAD213DF25683D77F |
region_code | PT |
postal_code | 1229-076 |
customer_type | RETURNING |
client_id | 9876543210.1761582117 |
user_id | user_DEF9876 |
ad_unit_name | Banner_02 |
event_name | purchase |
| Товары в корзине | |
item_id | SKU_12346 |
item_name | Google Grey Women's Tee |
item_affiliation | Google Merchandise Store |
item_coupon | SUMMER_FUN |
item_discount | 3.33 |
item_index | 1 |
item_brand | Google |
item_category | Apparel |
item_category2 | Adult |
item_category3 | Shirts |
item_category4 | Crew |
item_category5 | Short sleeve |
item_list_id | related_products |
item_list_name | Related Products |
item_price | 21.01 |
item_quantity | 2 |
Преобразуйте данные в объекты Event
Convert each event's formatted and hashed data to an Event . Populate the following fields as indicated:
Set
eventTimestampto the time the event occurred.Events for Google Analytics must have an
eventTimestampwithin the last 72 hours.Укажите обязательные поля в соответствии с вашим сценарием использования.
Вариант использования Идентификаторы transactionIdeventSourceOffline conversions or enhanced conversions for leads Обязательно . Укажите хотя бы одно из следующих значений: -
adIdentifierswith at least one ofgclid,gbraidorwbraidset - Session attributes
-
userData
Необязательный Required . Set to one of the enum values for EventSource.Events sent as an additional data source to a Google Ads destination Обязательно . Укажите хотя бы одно из следующих значений: -
adIdentifierswith at least one ofgclid,gbraid, orwbraidset -
userData
Необходимый Необязательно. Если задано, должно быть WEB.Events sent as an additional data source to a Google Analytics destination Обязательно . Укажите хотя бы одно из следующих значений: -
clientId -
adIdentifierswithgclidset -
userId
Необходимый Необязательно. Если задано, должно быть WEB.-
Populate any other fields where you have a value for the event. Refer to the
Eventreference documentation for the complete list of available fields.
Добавить атрибуты сессии
Если вы отправляете лиды для офлайн-конверсий или расширенных конверсий, добавьте атрибуты сессии , если другие идентификаторы объявлений, такие как GCLID или WBRAID, недоступны. Вы также можете включать атрибуты сессии в дополнение к другим идентификаторам объявлений.
Session attributes provide further context and signals about the user's interaction with your website, which can enhance conversion measurement, reporting and bidding accuracy.
In the Data Manager API, there are two approaches you can use to send session attributes:
Рекомендуется: установите поле
sessionAttributesобъектаadIdentifiersравным строке атрибутов сессии, закодированной в base64. Следуйте инструкциям в разделе «Как получить session_attributes» , чтобы изменить страницы отправки формы и настроить их на получение закодированной строки.If you can't use JavaScript, capture the individual session attribute fields and add each to the
experimentalFieldslist as a separateExperimentalField:-
gad_campaignid -
session_start_time_usec -
gad_source -
landing_page_url -
landing_page_referrer
If you have a value for the
landing_page_user_agentsession attribute, send it in theuserAgentfield ofadIdentifiers.landingPageDeviceInfo.Here are the best practices when sending individual key-value pairs:
- Consistently send
gad_campaignidandsession_start_time_usec. These fields are crucial for accurate attribution. - Не указывайте неточное или неполное значение
landing_page_urlнапример, строку-заполнитель, внутренний путь к приложению или неполный URL. Опуститеlanding_page_urlесли у вас нет точного полного URL.
Here's a portion of a sample event with entries in
experimentalFieldsforgad_campaignidandsession_start_time_usec, and the user agent in thelandingPageDeviceInfofield:{ ..., "experimentalFields": [ { "field": "gad_campaignid", "value": "21288051566" }, { "field": "session_start_time_usec", "value": "1767711548052000" } ], "adIdentifiers": { "landingPageDeviceInfo": { "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36" } } }-
Добавьте информацию из Google Analytics.
If the destinations for an event sent as an additional data source include a Google Analytics property, populate the following fields as indicated:
-
eventName Required . The name of the Google Analytics event.
-
transactionId Обязательно . Уникальный идентификатор события.
- По крайней мере один идентификатор
At least one of the following fields must be set:
clientId: Unique identifier for a user instance of a web client. See Send event to the Measurement Protocol .userId: A unique identifier for a user. See Measure activity across platforms with User-ID for more information.
-
destinationReferences Required if the request-level
destinationslist contains more than one Google AnalyticsDestination. Add an entry todestinationReferencesto specify which Google Analytics destination should receive the event. See send events to multiple destinations for more information about destination references.Если
destinationReferencesне задан или содержит несколько записей, ссылающихся на целевые ресурсы Google Analytics, API Data Manager отклоняет событие с ошибкойMULTIPLE_DESTINATIONS_FOR_GOOGLE_ANALYTICS_EVENT.-
userId Необязательно. Идентификатор пользователя.
-
additionalEventParameters Необязательно, но рекомендуется. Заполните этот список любыми параметрами событий Google Analytics, которые не отображаются в других полях
Event. Параметры могут включать дополнительные рекомендуемые параметры из событияpurchaseили другие параметры, которые вы хотите отслеживать. Используйте имя параметра Google Analytics в качествеparameterNameдляEventParameter.For example, if you have the taxes associated with a transaction, add an entry to
additionalEventParameterswithparameterNameset totax, andvalueset to the tax cost.Мы не рекомендуем добавлять записи для параметров события Google Analytics
transactionId,currencyилиvalue. Вместо этого заполните поляtransactionId,currencyиconversionValueEvent, которые имеют приоритет над любыми записями вadditionalEventParameters.
Добавить данные корзины для событий покупки
Заполните поле cartData объекта Event информацией о приобретенных товарах. Для каждого приобретенного товара добавьте объект Item в список items поля CartData и заполните следующие поля, как указано:
-
itemId - Обязательно . Уникальный идентификатор товара.
-
unitPrice Required . The unit price excluding tax, shipping, and event scoped (transaction-level) discounts.
If the item has an item scoped discount, use the discounted unit price. For example, if an item has a unit price of
27.67and a unit discount of6.66, then setunitPriceto21.01.-
quantity Required . The quantity of units purchased for this particular item.
-
additionalItemParameters Populate this list with any item scoped parameters that aren't captured in the other
Itemfields. Use the Google Analytics item parameter name for theparameterNameof theItemParameter.Например, если у вас есть марка и категория товара, добавьте в
additionalItemParametersэтого товара запись сparameterNameустановленным наitem_brand, иvalueравным названию марки, а также еще одну запись сparameterNameустановленным наitem_category, иvalueравным категории товара.Мы не рекомендуем добавлять записи для параметров товара Google Analytics
quantity,priceилиitem_id. Вместо этого заполнитеitemId,unitPriceиquantityItem, которые имеют приоритет над любыми записями вadditionalItemParameters.
Here's a sample Event for the formatted, hashed, and encoded data from the second event, with additional data for Google Analytics:
{
"adIdentifiers": {
"gclid": "GCLID_2"
},
"conversionValue": 42.02,
"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"
},
"eventName": "purchase",
"clientId": "9876543210.1761582117",
"userId": "user_DEF9876",
"additionalEventParameters": [
{
"parameterName": "ad_unit_name",
"value": "Banner_02"
}
],
"cartData": {
"transactionDiscount": 6.66,
"items": [
{
"itemId": "SKU_12346",
"quantity": 2,
"unitPrice": 21.01,
"additionalItemParameters": [
{
"parameterName": "item_name",
"value": "Google Grey Women's Tee"
},
{
"parameterName": "affiliation",
"value": "Google Merchandise Store"
},
{
"parameterName": "coupon",
"value": "SUMMER_FUN"
},
{
"parameterName": "discount",
"value": "3.33"
},
{
"parameterName": "index",
"value": "1"
},
{
"parameterName": "item_brand",
"value": "Google"
},
{
"parameterName": "item_category",
"value": "Apparel"
},
{
"parameterName": "item_category2",
"value": "Adult"
},
{
"parameterName": "item_category3",
"value": "Shirts"
},
{
"parameterName": "item_category4",
"value": "Crew"
},
{
"parameterName": "item_category5",
"value": "Short sleeve"
},
{
"parameterName": "item_list_id",
"value": "related_products"
},
{
"parameterName": "item_list_name",
"value": "Related Products"
}
]
}
]
}
}
Сформируйте тело запроса.
Combine the Destination and Events for the request body:
{
"destinations": [
{
"operatingAccount": {
"accountType": "OPERATING_ACCOUNT_TYPE",
"accountId": "OPERATING_ACCOUNT_ID"
},
"loginAccount": {
"accountType": "LOGIN_ACCOUNT_TYPE",
"accountId": "LOGIN_ACCOUNT_ID"
},
"productDestinationId": "CONVERSION_ACTION_1_ID"
}
],
"encoding": "HEX",
"events": [
{
"adIdentifiers": {
"gclid": "GCLID_1"
},
"conversionValue": 30.03,
"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"
},
"eventName": "purchase",
"clientId": "1234567890.1761581763",
"userId": "user_ABC12345",
"additionalEventParameters": [
{
"parameterName": "ad_unit_name",
"value": "Banner_01"
}
],
"cartData": {
"transactionDiscount": 6.66,
"items": [
{
"itemId": "SKU_12345",
"quantity": 3,
"unitPrice": 10.01,
"additionalItemParameters": [
{
"parameterName": "item_name",
"value": "Stan and Friends Tee"
},
{
"parameterName": "affiliation",
"value": "Google Merchandise Store"
},
{
"parameterName": "coupon",
"value": "SUMMER_FUN"
},
{
"parameterName": "discount",
"value": "2.22"
},
{
"parameterName": "index",
"value": "0"
},
{
"parameterName": "item_brand",
"value": "Google"
},
{
"parameterName": "item_category",
"value": "Apparel"
},
{
"parameterName": "item_category2",
"value": "Adult"
},
{
"parameterName": "item_category3",
"value": "Shirts"
},
{
"parameterName": "item_category4",
"value": "Crew"
},
{
"parameterName": "item_category5",
"value": "Short sleeve"
},
{
"parameterName": "item_list_id",
"value": "related_products"
},
{
"parameterName": "item_list_name",
"value": "Related Products"
}
]
}
]
}
},
{
"adIdentifiers": {
"gclid": "GCLID_2"
},
"conversionValue": 42.02,
"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"
},
"eventName": "purchase",
"clientId": "9876543210.1761582117",
"userId": "user_DEF9876",
"additionalEventParameters": [
{
"parameterName": "ad_unit_name",
"value": "Banner_02"
}
],
"cartData": {
"transactionDiscount": 6.66,
"items": [
{
"itemId": "SKU_12346",
"quantity": 2,
"unitPrice": 21.01,
"additionalItemParameters": [
{
"parameterName": "item_name",
"value": "Google Grey Women's Tee"
},
{
"parameterName": "affiliation",
"value": "Google Merchandise Store"
},
{
"parameterName": "coupon",
"value": "SUMMER_FUN"
},
{
"parameterName": "discount",
"value": "3.33"
},
{
"parameterName": "index",
"value": "1"
},
{
"parameterName": "item_brand",
"value": "Google"
},
{
"parameterName": "item_category",
"value": "Apparel"
},
{
"parameterName": "item_category2",
"value": "Adult"
},
{
"parameterName": "item_category3",
"value": "Shirts"
},
{
"parameterName": "item_category4",
"value": "Crew"
},
{
"parameterName": "item_category5",
"value": "Short sleeve"
},
{
"parameterName": "item_list_id",
"value": "related_products"
},
{
"parameterName": "item_list_name",
"value": "Related Products"
}
]
}
]
}
}
],
"validateOnly": true
}
- Update the placeholders in the body, such as
OPERATING_ACCOUNT_IDandPRODUCT_DESTINATION_IDwith the values for your account and destination. - Set
validateOnlytotrueto validate the request without applying the changes. When you're ready to apply the changes, setvalidateOnlytofalse. - Обратите внимание, что в этом примере шифрование не используется.
Отправить запрос
- Copy the request body using the copy button at the top right of the sample.
- Нажмите кнопку API на панели инструментов.
- Paste the copied request body into the Request body box.
- Click the Execute button, complete the authorization prompts, and review the response.
Ответы на вопросы об успехе
A successful request returns a response with an object containing a requestId .
{
"requestId": "126365e1-16d0-4c81-9de9-f362711e250a"
}
Record the requestId returned so you can retrieve diagnostics as each destination in the request is processed.
Реакции на неудачу
A failed request results in an error response status code such as 400 Bad Request , and a response with error details.
For example, an emailAddress 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 emailAddress 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"
}
]
}
]
}
}
Отправка событий в несколько пунктов назначения
If your data contains events for different destinations, you can send them in the same request by using destination references.
Например, если у вас есть событие для действия конверсии с ID 123456789 и другое событие для действия конверсии с ID 777111122 , отправьте оба события в одном запросе, установив reference для каждого Destination . reference определяется пользователем. Единственное требование — каждый Destination должен иметь уникальную reference . Вот измененный список destinations для запроса:
"destinations": [
{
"operatingAccount": {
"accountType": "OPERATING_ACCOUNT_TYPE",
"accountId": "OPERATING_ACCOUNT_ID"
},
"loginAccount": {
"accountType": "LOGIN_ACCOUNT_TYPE",
"accountId": "LOGIN_ACCOUNT_ID"
},
"productDestinationId": "PRODUCT_DESTINATION_ID",
"reference": "destination_a"
},
{
"operatingAccount": {
"accountType": "OPERATING_ACCOUNT_2_TYPE",
"accountId": "OPERATING_ACCOUNT_2_ID"
},
"loginAccount": {
"accountType": "LOGIN_ACCOUNT_2_TYPE",
"accountId": "LOGIN_ACCOUNT_2_ID"
},
"productDestinationId": "777111122",
"reference": "destination_b"
}
]
Установите параметры destinationReferences для каждого Event , чтобы отправить его в один или несколько конкретных пунктов назначения. Например, вот Event , предназначенное только для первого Destination , поэтому его список destinationReferences содержит только reference на первый Destination :
{
"adIdentifiers": {
"gclid": "GCLID_1"
},
"conversionValue": 1.99,
"currency": "USD",
"eventTimestamp": "2025-06-10T20:07:01Z",
"transactionId": "ABC798654321",
"eventSource": "WEB",
"destinationReferences": [
"destination_a"
]
}
Поле destinationReferences представляет собой список, поэтому вы можете указать несколько адресов назначения для события. Если вы не зададите поле destinationReferences для Event , API Data Manager отправит событие всем адресатам, указанным в запросе.
Если у события несколько пунктов назначения, API Data Manager отправляет соответствующие поля в каждый из них. Например, если у события есть пункт назначения Google Ads и пункт назначения Google Analytics, API включает поля Google Analytics, такие как clientId или eventName при отправке события в пункт назначения Google Analytics, и включает поля Google Ads, такие как customVariables при отправке события в пункт назначения Google Ads.
Следующие шаги
- 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 retrieve diagnostics for your requests.
- Узнайте о передовых методах .
- Узнайте об ограничениях и квотах .