Uploading information about calls

Uploads information about calls.

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).
  • DateTime — Unix timestamp of the date and time of the conversion.

Optional columns:

  • StaticCall — Whether the call was from a static number (1 — static, 0 — dynamic).
  • Price — Goal price (use a dot as the decimal separator).
  • Currency — Currency in three-letter ISO 4217 format.
  • PhoneNumber — Phone number without spaces (including the country and area code). For example: +79451234567.
  • TalkDuration — Duration of the call, in seconds.
  • HoldDuration — How long the call was on hold, in seconds.
  • CallMissed — Whether the call was missed (1 — missed, 0 — answered).
  • Tag — Any tag. You can use it to mark the call quality, result of the call, and so on. For example: "client wasn't happy with price".
  • FirstTimeCaller — First time caller (1 — new caller, 0 — repeat caller).
  • URL — URL the call was tracked from (associated with a page event). For example, this could be a landing page for an ad campaign that shows the phone number (PhoneNumber).
  • CallTrackerURL — URL leading to the call tracker interface.
  1. Request syntax
  2. Request message body
  3. Response format

Request syntax

counterId — ID of the counter that you want to upload information about calls for.

https://api-metrica.yandex.net/management/v1/counter/{counterId}/offline_conversions/upload_calls
 ? [client_id_type=<offline_conversion_uploading_client_id_type>]
 & [comment=<string>]
 & [new_goal_name=<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.
new_goal_nameThe name of a new target for calls if this target doesn't exist. If it exists, the parameter is ignored.

Request message body


POST https://api-metrica.yandex.net/management/v1/counter/{counterId}/offline_conversions/upload_calls
Content-Type: multipart/form-data; boundary=------------------------7zDUQOAIAE9hEWoV
Context-Length: 643

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

ClientId,DateTime,Price,Currency,PhoneNumber,TalkDuration,HoldDuration,CallMissed,Tag,FirstTimeCaller,URL,CallTrackerURL
133591247640966458,1481714026,678.90,RUB,+71234567890,136,17,0,,1,https://test.com/,https://test.com/
579124169844706072,1481718066,123.45,RUB,+70987654321,17,23,0,,2,https://test.com/,https://test.com/
148059425477661429,1481718126,678.90,RUB,+71234509876,72,11,0,,0,https://test.com/,https://test.com/
--------------------------7zDUQOAIAE9hEWoV--

Request example

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

Response format


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