Skip to main content
Tracking code implementation
Jan Tlapak avatar
Written by Jan Tlapak
Updated over a week ago

To get statistics with Ecomail, such as the behavior of individual subsribers on your website, including purchases made, movements on your site and subsequent segmentation, paste the following code on your site.

Warning: Do not forget to replace the part of the code --- !!! INSERT YOUR ACCOUNT ID !!! --- HERE with the identifier (name) of your account. This name is the same as the beginning of your account address.

So, for example, the account foo ( will have in this code:

appId: 'foo'

Paste this code into each page immediately after the "body" tag:

<!-- Ecomail starts growing -->
<script type="text/javascript">
window.ecotrack('newTracker', 'cf', '', { // Initialise a tracker
appId: '--- !!! INSERT YOUR ACCOUNT ID !!! ---'
window.ecotrack('setUserIdFromLocation', 'ecmid');
<!-- Ecomail stops growing -->

To enable movement tracking, you will need to "tag" your campaign links by turning on Google Analytics campaign tracking. Alternatively, you can tag each link manually by adding the variable "ecmid" with the merge tag value *|ECMID|*, as follows:*|ECMID|*


If you want to test your tracking code, you can easily track yourself in two ways:

1. Insert the following string after the link and replace it with your email, which you have in the contact list: ? (eg or

2. Run a snippet via the console in the browser (eg in Google Chrome via Developers tools or F12> console) and replace it with your email:

window.ecotrack ('setUserId', '');

window.ecotrack ('trackPageView');

If you have any further questions, you can contact us at


Did this answer your question?