Uploading offline conversions

Uploads offline conversions.

Tip

Create a CSV file with the data and pass it using this method.

We also recommend generating API requests automatically using modules written in a programming language.

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

Note

  1. It can take up to 2 hours to process the data.
  2. The file size limit is 1 GB.
  3. The file encoding is UTF-8.

Request

POST

https://api-metrica.yandex.net/management/v1/counter/{counterId}/offline_conversions/upload

Path parameters

Name

Description

counterId*

Type: integer<int32>

ID of the counter for which you want to upload offline conversions.
Example: 2215573

Query parameters

Name

Description

comment

Type: string

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

Body

multipart/form-data
{
    "file": null
}

Name

Description

file*

Type: string<binary>

Offline conversions to upload, which are passed as multipart/form-data. The file size limit is 1 GB. The file encoding is UTF-8.

Responses

200 OK

OK

Body

application/json
{
    "uploading": {
        "id": 0,
        "create_time": "2022-12-29T18:02:01Z",
        "source_quantity": 0,
        "line_quantity": 0,
        "comment": "string",
        "client_id_type": "USER_ID",
        "status": "string"
    }
}

Name

Description

uploading*

Type: OfflineConversionUploading

Information about an upload of offline conversions.

OfflineConversionUploading

Information about an upload of offline conversions.

Name

Description

client_id_type

Type: string

Type of user IDs. Possible values:

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

Example: USER_ID

comment

Type: string

Arbitrary comment. The maximum number of characters is 255.

Min length: 0

Max length: 255

create_time

Type: string<date-time>

Upload time.

id

Type: integer<int64>

Upload ID.

line_quantity

Type: integer<int32>

Number of rows that passed validation during upload.

source_quantity

Type: integer<int32>

Number of rows in the source file.

status

Type: string

Upload status:

  • PREPARED: Upload prepared.
  • UPLOADED: Upload complete.
  • EXPORTED: Upload exported.
  • MATCHED: Event IDs have been matched.
  • PROCESSED: Upload processed successfully.
  • LINKAGE_FAILURE: Couldn't find a matching user ID. If you pass information about static calls, they won't be linked to sessions in Yandex Metrica — but they will be included in call reports.