Setting up delivery of detailed data about customers and orders from a CRM
- Step 1. Preparing data to be linked to sessions
- Step 2. Preparing customer and order data
- What's next?
Step 1. Preparing data to be linked to sessions
- Get the IDs using the getClientID JavaScript API method.
- Save the IDs in your CRM.
- 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.
Step 2. Preparing customer and order data
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?
- 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.
- About customers
-
- In a CSV file using the POST /cdp/api/v1/counter/{counterId}/data/contacts method.
- In the request body using the POST /cdp/api/v1/counter/{counterId}/data/contacts/json method.
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
-
- In a CSV file using the POST /cdp/api/v1/counter/{counterId}/data/orders method.
- In the request body using the POST /cdp/api/v1/counter/{counterId}/data/orders/json method.