Uploading data
Data is transmitted to https://mc.yandex.ru/collect
with POST|GET requests. Each parameter in the request represents a key-value
pair. There are required parameters that depend on the type of interaction, and additional parameters that expand the service's capabilities for analyzing the transmitted data. All parameter values must be URL-encoded and encoded in UTF-8 format (see the example of sending a pageview).
Supported parameters
Parameter |
Description |
Comment |
|
Tag ID |
Required |
|
Client ID |
Required |
|
Type of interaction. Possible values:
|
Required |
|
Referrer |
Required for the |
|
Page URL |
Required for the |
|
Page title |
Required for the |
|
Goals |
Required for the |
|
E-commerce: transaction |
Required for the |
|
E-commerce: transaction revenue |
Required for the |
|
E-commerce: transaction coupon |
Required for the |
|
Time of the event in timestamp format |
If it isn't transmitted, the data send time is used. You can transmit data up to 12 hours back from the current time. |
|
E-commerce action with the product (advanced E-commerce). Possible values:
|
Required for the |
|
E-commerce: product code |
Required for the |
|
E-commerce: product name |
Required for the |
|
E-commerce: product brand |
Required for the |
|
E-commerce: product category |
Required for the |
|
E-commerce: product price |
Required for the |
|
E-commerce: item quantity |
Required for the |
|
E-commerce: type of product |
Required for the |
|
E-commerce: product coupon code |
Required for the |
|
E-commerce: product position |
Required for the |
|
Window size |
Parameter value format: |
|
Currency |
Supported for goals with a value and for E-commerce events |
|
Goal value |
Supported when transmitting goals |
|
Secret token |
Generated if the Measurement Protocol feature is enabled |
Examples of data transmission
Transmitting a pageview
https://mc.yandex.ru/collect/?tid=5564333&cid=1710232430899999999&t=pageview&dr=https%3A%2F%2Fyandex.ru&dl=https%3A%2F%2Ftest.com&dt=Test&et=1632467908&ms=01c0a669-d38c-4385-9d22-47cf894ed687
Achieving a JavaScript "order-success" goal
https://mc.yandex.ru/collect/?tid=5564333&cid=1710232430899999999&t=event&ea=order-success&et=1632467909&dl=https%3A%2F%2Ftest.com&ms=01c0a669-d38c-4385-9d22-47cf894ed687
Viewing a product card for an Apple iPhone priced at 50,000 with SKU 456
https://mc.yandex.ru/collect/?tid=5564333&cid=1710232430899999999&t=event&et=1632467910&pa=detail&pr1id=456&pr1nm=iphone&pr1br=apple&pr1pr=50000&ms=01c0a669-d38c-4385-9d22-47cf894ed687
Adding an item to the shopping cart
https://mc.yandex.ru/collect/?tid=5564333&cid=1710232430899999999&t=event&et=1632467911&pa=add&pr1id=456&pr1nm=iphone&pr1br=apple&pr1pr=50000&ms=01c0a669-d38c-4385-9d22-47cf894ed687
Purchasing an item
https://mc.yandex.ru/collect/?tid=5564333&cid=1710232430899999999&t=event&et=1632467912&pa=purchase&pr1id=456&pr1nm=iphone&pr1br=apple&pr1pr=50000&ti=4555&tr=50000&ms=01c0a669-d38c-4385-9d22-47cf894ed687
Purchasing multiple items
https://mc.yandex.ru/collect/?tid=5564333&cid=1710232430899999999&t=event&et=1632467913&pa=purchase&pr1id=456&pr1nm=iphone&pr1br=apple&pr1pr=50000&pr2id=459&pr2nm=airpods&pr2br=apple&pr2pr=20000&ti=4555&tr=70000&ms=01c0a669-d38c-4385-9d22-47cf894ed687
Special considerations
- You can use the Measurement Protocol to create a new session or add information to an existing one.
- To create a session, specify the user's
ClientID
. - To create a session, you need to transmit at least one pageview (
t=pageview
) at the start of the session. - These sessions adhere to the same rules and restrictions as regular sessions.
- You can transmit data up to 12 hours back from the current time. If you don't send the
et
parameter, the data send time is specified instead. - You can update a session only within the session timeout specified manually in the tag settings using the
et
parameter or by sending data without this parameter within the session timeout. Exceeding the timeout starts a new session (after you send apageview
).