Setting up delivery of detailed data about customers and orders from a CRM

  1. Step 1. Preparing data to be linked to sessions
  2. Step 2. Preparing customer and order data
  3. What's next?

Step 1. Preparing data to be linked to sessions

Yandex Metrica uses customer characteristics (phone numbers and email addresses) or special ClientIDs for linking data.
Attention. Pass ClientIDs to make sure that the maximum number of orders is counted for ad campaign optimization and included in end-to-end analytics reports.
To use ClientIDs to work with data from your CRM:
  1. Get the IDs using the getClientID JavaScript API method.
  2. Save the IDs in your CRM.
  3. Upload them with your customer data.

See the description of the format for data that can be passed to Yandex Metrica: about customers and about orders.

Note. Some CRM request providers can automatically pass the ClientID when creating a request.

Step 2. Preparing customer and order data

Note. You can transmit data for up to 100,000 orders per customer.
When preparing data for uploading to Yandex Metrica:
  • Group all the statuses in your CRM according to the types of statuses in Yandex Metrica:

    • IN_PROGRESS: In progress.
    • PAID: Paid.
    • CANCELED: Canceled.
    • SPAM: Spam.

    This is necessary for generating “End-to-end analytics” reports: only the statuses that are arranged in groups will be linked to sessions. The reports will contain the types listed above rather than the statuses you pass.

    Map the transmitted order statuses to the status types in Yandex Metrica using the POST /cdp/api/v1/counter/{counterId}/schema/order_statuses method. For example, the “New” status with the “new” ID can be assigned the IN_PROGRESS type, and the “Successful” status with the “success” ID — the PAID status.

    In Step 3, upload order data with statuses from your CRM (for example, “new”).

  • Determine what additional customer and order data you want to pass. You can use this information to set up ad campaign targeting in Yandex Direct.

    For example, you can create an attribute named “shoe size” and generate an audience segment with the specified size. You can then set up an ad campaign retargeting this audience segment and serve a special offer to them.

    Examples of additional data: customer type (VIP, individual, or business), service type, and product category.

    To create additional attributes, use the POST /cdp/api/v1/counter/{counterId}/schema/attributes method with the following path parameter:
    • entity_type=contact to pass custom fields for customers.

    • entity_type=order to pass custom fields for orders.

  • (Optional) Upload lists of products that are included in the transmitted orders. To do this, use the POST /cdp/api/v1/counter/{counterId}/schema/products method.

What's next?

Pass the customer and order data in CSV format or inside a request in JSON format. There are several ways to transmit data in CSV format:
  • As a CSV file. In the file, specify the data that you want to pass to Yandex Metrica.
  • As multipart/form-data. The first line must include column names.
Upload the data from the CRM to Yandex Metrica:
About customers

We recommend doing the first upload of customer information as early as possible: order data will be linked to sessions that took place after the first successful upload of customer information.

About orders