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

tid

Tag ID

Required

cid

Client ID

Required

t

Type of interaction. Possible values:

  • pageview
  • event (JavaScript event, E-commerce events)

Required

dr

Referrer

Required for the pageview event

dl

Page URL

Required for the pageview event and any event event, if the option "Receive data only from specified addresses" is enabled.

dt

Page title

Required for the pageview event

ea

Goals

Required for the event event

ti

E-commerce: transaction

Required for the event event and pa=purchase

tr

E-commerce: transaction revenue

Required for the event event and pa=purchase

tcc

E-commerce: transaction coupon

Required for the event event and pa=purchase

et

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.

pa

E-commerce action with the product (advanced E-commerce). Possible values:

  • detail: Viewing the item.
  • add: Adding the item to the shopping cart.
  • remove: Removing the item from the shopping cart.
  • purchase: Purchasing.

Required for the event event

pr<productIndex>id

E-commerce: product code

Required for the event event and pa!=null. In productIndex, specify the serial number of the product in the list

pr<productIndex>nm

E-commerce: product name

Required for the event event and pa!=null. In productIndex, specify the serial number of the product in the list

pr<productIndex>br

E-commerce: product brand

Required for the event event and pa!=null. In productIndex, specify the serial number of the product in the list

pr<productIndex>ca

E-commerce: product category

Required for the event event and pa!=null. In productIndex, specify the serial number of the product in the list

pr<productIndex>pr

E-commerce: product price

Required for the event event and pa!=null. In productIndex, specify the serial number of the product in the list

pr<productIndex>qt

E-commerce: item quantity

Required for the event event and pa!=null. In productIndex, specify the serial number of the product in the list

pr<productIndex>va

E-commerce: type of product

Required for the event event and pa!=null. In productIndex, specify the serial number of the product in the list

pr<productIndex>cc

E-commerce: product coupon code

Required for the event event and pa!=null. In productIndex, specify the serial number of the product in the list

pr<productIndex>ps

E-commerce: product position

Required for the event event and pa!=null. In productIndex, specify the serial number of the product in the list

sr

Window size

Parameter value format: 1440x900x30

cu

Currency

Supported for goals with a value and for E-commerce events

ev

Goal value

Supported when transmitting goals

ms

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 a pageview).