Uploading offline conversions

Attention.

Access tokens will not be accepted in URL parameters starting February 13, 2019. To continue working with the Yandex.Metrica API, set up authorization by passing the token in the HTTP header.

The outdated authorization method will be temporarily disabled on January 23, January 30, and February 6 for maintenance. Authorization using URL parameters will be unavailable on these dates.

Uploads information about offline conversions.

Transmit data as multipart/form-data in CSV format, with the first row containing the column headers.

Required columns:

  • UserId — Site user ID assigned by the site owner (only for client_id_type = USER_ID)
  • ClientId — Site user ID assigned by Yandex.Metrica (only for client_id_type = CLIENT_ID)
  • Target — Target ID.
  • DateTime — Unix timestamp of the date and time of the conversion.

Optional columns:

  • Price — Goal price (use a dot as the decimal separator).
  • Currency — Currency in three-letter ISO 4217 format.
  1. Request syntax
  2. Request message body
  3. Response format

Request syntax

counterId — ID of the counter 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 parameters
client_id_typeType of user identifiers.

Allowed values:

  • CLIENT_ID — Site user ID assigned by Yandex.Metrica.
  • USER_ID — Site user ID assigned by site owner.
commentComments.

Request message body


POST https://api-metrica.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.