Uploading offline conversions

Uploads offline conversions.

Data is passed as multipart/form-data in CSV format. The first line of the request must pass the column names.

Required columns:

  • UserId — The site user ID assigned by the site owner (only for client_id_type = USER_ID).
  • ClientId — The site visitor ID assigned by Yandex.Metric (only for client_id_type = CLIENT_ID).
  • Yclid — The ID of a click on a Yandex.Direct ad assigned by Yandex.Direct (only for client_id_type = YCLID).
  • Target — Goal ID.
  • DateTime — Date and time of conversion in unix timestamp.

Optional columns:

  • Price — The cost of the goal, using a dot (.) as the decimal separator.
  • Currency — The currency using the three-letter code from the ISO 4217 standard.
  1. Request syntax
  2. Request message body
  3. Response format

Request syntax

counterId — ID of the tag that you want to upload offline conversions for.

https://api-metrica.yandex.net/management/v1/counter/{counterId}/offline_conversions/upload
 ? [client_id_type=<offline_conversion_uploading_client_id_type>]
 & [comment=<string>]
Query-параметры
client_id_typeType of user identifiers.

Allowed values:

  • USER_ID — Site user ID assigned by site owner.
  • CLIENT_ID — Site user ID assigned by Yandex.Metrica.
  • YCLID — The ID of a click on a Yandex.Direct ad assigned by Yandex.Direct.
commentComments.

Request message body


POST http://api-metrika.yandex.net/management/v1/counter/{counterId}/offline_conversions/upload?client_id_type=CLIENT_ID
Content-Type: multipart/form-data; boundary=------------------------7zDUQOAIAE9hEWoV
Context-Length: 253

--------------------------7zDUQOAIAE9hEWoV
Content-Disposition: form-data; name="file"; filename="data.csv"
Content-Type: text/csv

ClientId,Target,DateTime,Price,Currency
133591247640966458,GOAL1,1481718166,123.45,RUB
133591247640966458,GOAL2,1481718142,678.90,RUB
133591247640966458,GOAL3,1481718066,123.45,RUB
579124169844706072,GOAL3,1481718116,678.90,RUB
148059425477661429,GOAL2,1481718126,123.45,RUB
148059425477661429,GOAL3,1481714026,678.90,RUB
--------------------------7zDUQOAIAE9hEWoV--

Request example

POST https://api-metrica.yandex.net/management/v1/counter/{counterId}/offline_conversions/upload?client_id_type=USER_ID

Response format


{
    "uploading" :  < uploading > 
}
Parameters Description
uploading Information about the upload of offline conversions.