[MakeShop.pro] Integration with Roystat

The module transmits roistat_visit to My Store (moysklad.ru). Developed by MakeShop.pro
Please enter a valid addres(es) of the shop where you are going to use the add-on.



Roistat is multichannel analytics. Roistat tools help marketers, analysts and business owners work with analytics, leads, traffic, sales and loyalty.

Module "Integration with Roistat"

The module is easy to install, but customization will require care. After configuration, it allows you to transfer the prepared data to the Roistat service by referring to its API. The transfer occurs when creating, editing and changing orders (as well as their statuses), changing user data. It is also possible to set up data transfer using the MoySklad service: the data is transferred to MoiSklad, and from there it is sent to Roistat.

Module features

  • Easy installation.
  • Configuring the transmitted data.
  • Instant sending of information.
  • Possibility of data transfer through MoiStore - transfer of roistat_id to MoiSklad.


  • Transfer of the cost price of the order specified as a percentage of the order value.
  • Transferring the cost of an order from a (module from Retail Factory). (module от Retail Factory).


No posts found

Write a review



After downloading module, its installation is performed using standard CS-Cart tools on the page Administration panelAdd-ons Manage add-ons Download and install modules (+).

For CS-Cart version over 4.13.1Panel of admin →Add-ons → Manage add-ons → Gear Button → Manual Installation

Click Download, in the window that appears, select the module file, then Upload & Install

Integration of exchange with the Roistat service directly from the CS-Cart store

Principle of operation

When creating, editing and changing orders, as well as their statuses or changing user data, the formatted data is transferred to the Roistat service by calling its API (https://roistat.api-docs.io/v1/obshie-svedeniya)

Pre-configuring the Roistat service

After registering and creating a new project in the service, you need to find and copy the following data:

1. Meter number

The number is located in the project settings, menu item Counter code.

The number is copied in one line. 

2. User API key

The key is located in the user profile settings, API menu item.

Click the Show button and copy the API key.

3. Copy the project number.

The project number is indicated in the service header.

4.Connect the RoistatAPI module in the integration catalog of the Roistat service

This completes the preliminary configuration of the service. As soon as the first transactions get into the system and they are processed (1-2 hours depending on the load on the Roistat service), then the "Project status" section will take the appropriate form:

It will be possible to update the analytic data without waiting in a queue for processing.

Add-on setup

The module is configured in the CS-Cart administrative panel on the "Manage add-ons" page"

STEP 1.It is necessary to fill in all the fields on the Parameters tab. 

After saving the counter ID, API key and project number in the module settings, the module will check the connection with the Roistat service and display a button that allows you to upload order statuses and existing orders in your store.

If there are data errors, a corresponding message will be displayed

STEP 2. It is required to configure the unloaded fields.

The Roistat system requires 3 required fields to receive applications:
Deal ID, Deal creation date, Deal status IDthese fields are downloaded automatically and do not require any setting on the part of the user.

You can select the rest of the fields for uploading on the Exported fields tab.

Common fields:

Trade name -human-readable name of the transactions of the type "Order No.".
Roistat code
- visit number.
Order amount - transaction amount; used in the key figure Revenue in Roistat.
Client id
- Client id - client ID in CS-Cart.
Cost price- the cost price of the transaction (to work, you need a module from RetailFactory Costs and Profits of a store).

Additional fields:

Showcase - the name of the store where the order was made.

Loading data

The initial data loading takes place in the module settings, when you click on the "Upload everything to Roistat" button.

First of all, the statuses of orders from your store will be created and placed in the "In Progress" category.


If, while working with the module, the button "Upload everything to Roistat" is pressed again, then all order statuses will again be transferred to the "In Progress" category.

After unloading the statuses of orders, all previously created orders will be unloaded, except for orders with the "Incomplete" status. Please note that orders with this status are never processed or uploaded to Roistat!

Integration of the exchange with the Roistat service through the MoySklad service


If you are configuring the module for integration with Roistat through MoySklad, then there is no need to fill in the fields "Your API key" and "Project number". In this case, the main configuration is carried out on the side of the Roistat and MoySklad services.

Principle of working

  1. After creating orders, we add the value from the COOKIE roistat_visit to the ms_roistat field (table ?:orders) in the database created during the installation of the module.
  2. When synchronizing with MoySklad, add the roistat field (roistat_visit code) and showcase (storefront name) to the xml file.
  3. Roistat with MoySklad is configured and synchronized separately from the module.

Pre-configuring the Roistat service

1. After registering and creating a new project in the service, you need to find and copy the following data from your account in the Roistat system.

Counter number

The number is located in the project settings, menu item Counter code.

The number is copied in one line.

2. Next, you need to insert the counter code into the corresponding field of the module settings.

3. Now we have to change the code of the third-party module rus_exim_1c.

   а. Manual code change.

In the file /app/addons/rus_exim_1c/Tygh/Commerceml/RusEximCommerceml.php add the code fn_set_hook('rus_exim_1c_order_data', $order_data, $order_xml);  into the function public function dataOrderToFile($xml, $order_data, $lang_code).
An example of the added code:

public function dataOrderToFile($xml, $order_data, $lang_code)
        $export_statuses = $this->s_commerceml['exim_1c_export_statuses'];
        $cml = $this->cml;
        $order_xml = $this->getOrderDataForXml($order_data, $cml);
        // new hook for module ms_roistat
        fn_set_hook('rus_exim_1c_order_data', $order_data, $order_xml);
        if (empty($order_data['firstname'])) {

   б. Automatic code addition.
It is possible to automate the process of adding code to a third-party add-on by installing our ms_addon_fixer module and applying the Add Hook for Roistat fix in it.

This completes the add-on configuration and you need to configure the MoySklad service.

Setting up the service MoySklad

In your service account, go to the Sales → Buyers' orders tab and click the Settings (gear) button.

In the window that appears, we add two fields, such as string, roistat and showcase.

Further, the connection is configured according to the official instructionshttps://www.cs-cart.ru/docs/4.11.x/user_guide/addons/commerceml/moy_sklad/.

Synchronization of orders occurs according to the configured schedule of the MySklad system.


v2.0.8 from 11.09.21

[*] Changed MakeShop.pro icon.

v2.0.7 from 02.09.21

[!] Fixed dependency on the module, now it affects a separate cost field, and not the entire module.

v2.0.4 from 11.08.2021

[+] Added integration with the [RetailFactory] add-on Costs and profits of the store.
[+] Added a cost price field from a dependent add-on.

v2.0.3 from 12.11.2019

[!] Fixed unloading errors.

v2.0.2 from 10.10.2019

[!] Fixed unloading errors.

v2.0.1 from 03.10.2019

[+] Added direct integration with RoistatAPI.
[+] Manual upload of statuses of orders, customers and orders.
[+] Automatic unloading of Orders and Clients when adding, updating or changing the status of an order.
[+] Organized logging of requests to RoistatAPI to the file app / addons / ms_roistat / log.txt.

v1.5.1 from 10.09.2019

[+] Added a showcase field for uploading to MoySklad "showcase"
[-] The order_status.post smart hook has been removed.
[+] Added smart-hook details_sidebar.pre.tpl.