MyTracker supports key ecommerce events of orders and refunds.
By changing the event parameters, you can send all order actions:
order placement with payment;
order placement without payment;
payment for a previously placed order;
canceled or partially canceled order;
full or partial refund;
product replacement in an order.
Use the dataLayer container to transfer events to MyTracker.
Send each event to the container as a JavaScript object using the push method.
Event parameters and sample scripts are described below.
You can also use S2S API to send events.
Including for orders in mobile apps and events that are not tracked on the site,
for example, when you change the order status in the order management system.
Data format
MyTracker supports the popular Ecommerce data transfer formats,
which correspond to Google Analytics and Yandex Metrics markup.
The name of the product. For example, Xiaomi Redmi Wath 3.
affiliation
String
The supplying company or store to which the product belongs. For example, Xiaomi store.
price
Number
The monetary value of the product
discount
Number
The monetary discount value associated with the product
coupon
String
The name or coupon code associated with the product
tax
Number
Tax cost associated with the product. Value from 1 to 100, in percent.
index
Integer
Product position in the list
item_brand
String
The brand of the product. For example, Xiaomi.
item_variant
String
A variation of the product. For example, Green.
item_list_id
String
The ID of the list in which the product was presented to the user
item_list_name
String
The name of the list in which the product was presented to the user. For example, New.
item_category1
String
One of the categories to which the product belongs. For example, electronics.
item_category2
String
One of the categories to which the product belongs. For example, phones and watches.
item_category3
String
One of the categories to which the product belongs. For example, a watch.
item_category4
String
One of the categories to which the product belongs. For example, a smartwatch.
location_id
String
The identifier or name of the product location,
store, pick-up point, etc.
quantity
Integer
The number of product units
* — required parameters
Sending orders
To send orders, use the mt_order event.
In the status parameter, send the action:
ADD to add a product.
PAY to pay for a product.
If the status is not sent, the order will be considered fully paid for
(the default status is PAY).
Examples of sending different events:
Event
Parameters
Order placement with payment
event: "mt_order"
status: "PAY"
Send an event when the user has placed and fully paid for an order on the site.
Order placement without payment
event: "mt_order"
status: "ADD"
Send an event when the user has placed a pending payment order.
For example, the user will pay for the order at the pick-up point
or with the courier.
Full or partial payment of the order
Payment of the order implies that the mt_order
event was sent before it. Possible chain of action: ADD→PAY.
event: "mt_order"
status: "PAY"
order_id: <previously placed order number>
items: <description of paid products>
Send an event when a user has paid for the product.
Adding a product to an order
Adding a product implies that the mt_order
event was sent before it. Possible chains of action:
ADD→ADD, ADD→PAY, PAY→ADD, PAY→PAY.
event: "mt_order"
status: "PAY" if products are paid for
status: "ADD" if products are not paid for
order_id: <previously placed order number>
items: <description of added products>
To send multiple order actions, use the same order_id
but a different action_id.
It is not necessary to use sequential numbering for actions.
For example, action_id: "005" for placing an order, action_id: "001" for adding a product, action_id: "038" for payment.
When sending different events mt_order and mt_refund,
you can repeat the action_id. For example,
action_id: "001" for order placement
and action_id: "001" for refund.
To replace a product,
use the mt_refund and mt_order events sequentially
In Google Analytics markup, each transaction is equated to an order,
there are no fields for status transfer.
As a result, MyTracker records the purchase event as a fully paid order,
and the refund event as a full refund.
To track order status, and send partial additions, payments, and product cancellations,
we recommend using MyTracker markup — mt_order and mt_refund events.
Sending Yandex Metrica events
If you use Yandex Metrica, MyTracker can collect purchase events automatically.
You only need to install the MyTracker counter on your site and enable Ecommerce event tracking,
no other settings are required.
In Yandex Metrica markup, each transaction is equated to an order,
there are no refund events and there is no field for status transfer.
As a result, MyTracker records the purchase event as a fully paid order.
To send refunds, partial additions, payments, and product cancellations,
we recommend using MyTracker markup — mt_order and mt_refund events.