Uploading offline conversions

Uploads offline conversions.

Tip. Create a CSV file with the data and send it using this method. We also recommend generating API requests automatically using modules written in a programming language.
Note. It can take up to 24 hours to process the data.

To learn about which data to transmit and to view a sample request, see Passing offline conversions.

  1. Request syntax
  2. In the request body
  3. Response format
  4. What's next?

Request syntax

counterId: ID of the tag for which you want to upload offline conversions.

POST https://api-metrika.yandex.net/management/v1/counter/{counterId}/offline_conversions/upload
 ? client_id_type=<offline_conversion_uploading_client_id_type>
 & [comment=<string>]
client_id_type *Type of user IDs.

Acceptable values:

  • client_id: Site user ID assigned by Yandex Metrica.
  • user_id: Site user ID assigned by the site owner.
  • YCLID: The ID of a click on a Yandex Direct ad assigned by Yandex Direct.
comment

Comment.

Maximum 255 characters. Can contain digits as well as Latin and Cyrillic letters.

client_id_type *Type of user IDs.

Acceptable values:

  • client_id: Site user ID assigned by Yandex Metrica.
  • user_id: Site user ID assigned by the site owner.
  • YCLID: The ID of a click on a Yandex Direct ad assigned by Yandex Direct.
comment

Comment.

Maximum 255 characters. Can contain digits as well as Latin and Cyrillic letters.

* Required

In the request body


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

Sample request

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

Response format


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

What's next?

To track the upload status for the conversions linked by ClientID or UserID, use the GET /management/v1/counter/{counterId}/offline_conversions/uploading/{id} method.