<script>
window.dataLayer = window.dataLayer || [];
</script>
To enable Ecommerce analytics, you may need help from your website developer or a JavaScript expert. Detailed instructions are given below.
You can also send Ecommerce events via S2S API. Including orders in mobile apps and events that are not tracked on the site, such as status changes in the order management system.
If not already done, install the counter code on your website.
A Data Layer is an array of JavaScript objects that can be used to transfer data from the site to other services, such as MyTracker.
If you use Google Analytics Enhanced Ecommerce, Google Analytics Ecommerce (GA4), or Yandex Metrica to track Ecommerce events, then that means the Data Layer has already been added to your website pages, and you can skip this step.
If you are not using the analytics tools listed above,
then add a dataLayer
container in the BODY
or HEAD
block on your site pages
that contain Ecommerce product and order data.
<script>
window.dataLayer = window.dataLayer || [];
</script>
Configure the sending of Ecomm events to the dataLayer. Send events with product data as JavaScript objects using push methods. For details, refer to the Sending Ecommerce events section.
The event markup in MyTracker corresponds to Google Analytics Enhanced Ecommerce,
Google Analytics Ecommerce (GA4), and Yandex Metrica.
If you have already configured the purchase
and refund
events,
MyTracker will start collecting data after you enable Ecommerce event tracking.
We recommend learning the event sending format anyway, because MyTracker allows you to collect data not only on individual products but on orders as a whole, and supports partial payments and refunds
To enable MyTracker to receive data on Ecomm events, change the counter settings:
It might take up to four hours for the tracking to start or stop after you toggle. For how to analyze the data, see the Ecommerce reports section.