Email tracking allows to track down the source of client's requests sent by e-mail. It works the following way: when a customer visits your website, he sees the substitution e-mail address. When he sends a request on this e-mail address, the request is redirecting to the real address you specified in email tracking settings. 

Email Tracking Setup

Email tracking setup is a fairly simple process. It consists of several steps:

Step 1. Specify the substituted e-mail address and substitution addresses 

  1. Click the All items button in your Roistat project and open Emailtracking section:

  2. Enter the real e-mail address that will receive messages from your clients in Substitute mail address field: 
  3. Select the way of forming the substitution email addresses your clients will see on the website: 
  4. Using the email service settings page, configure the redirection from substitute addresses to the address specified in para 2.  
  5. Click the Save button.

(информация) Roistat calculates the recommended number of substitute e-mail addresses from your website attendance within the last 3 days. 
(информация) Substitute e-mail will be linked to the visit number within 15 minutes.

Step 2. Activate email tracking

Activate the email tracking by dragging the Track emails bar to the right:

Now, the email address that receives the messages, is substituted by the algorithm you specified in the previous step. 

If you want to deactivate email tracking on particular webpages, use the following JS API method: 

window.onRoistatModuleLoaded = function () {
    window.roistat.emailtracking.enabled = false;

Step 3. Configure the synchronization of Roistat with your email server

  1. In the Mail server settings (IMAP), write in:  
  2. Click the Test connection button to test the correctness of entered data. 

  3. Click the Save button.

Synchronization will allow downloading the messages from your mailbox to the Roistat project. 

(warning)  Roistat project receives the messages only from the Inbox folder. 

How to configure the synchronization with Gmail

  1. In Gmail settings open Forwarding and POP/IMAP and make sure that IMAP access is enabled:

  2. Follow this link and allow less secure apps access:
  3. Follow this link and click the Continue button to allow Roistat to have access to your Gmail account without your prior confirmation.

Step 4. Configure the automatic request creation in CRM

How to send to CRM messages with requests loaded in Roitat project:

  1. Click the Send to CRM checkbox in the Automatic Leads creation section. If needed, specify the additional field values in the Additional field settings as follows: field1=value1, field2=value2, etc:

  2. Click the Save button. 
  3. To send messages with requests via webhook, fill in the Webhook address field:

    After the message with visit number was loaded to your project, Roistat sends POST-request to the destination address.

    POST-request body contains JSON-object, that sends the following information about the request: 

      "id": "111",// unique message number in Roistat
      "email_id": "222", // unique message number in your email
      "visit_id": "123456", // visit number
      "subject": "Re: Test", // subject of the message
      "text": "Test message", // text of the message
      "email_from": "", // email from where the message came from
      "email_to": "", // address the email was sent
      "attachments": [], // attached files
      "referrer": "", // landing page
      "marker": "fb_new", // visit source
      "city": "New York", // city
      "country": "USA", // country
      "ip": "", // IP-address
      "first_visit": "1001", // first visit
      "domain": "", // website domain
      "landing_page": "", // landing page
      "utm_source": null,
      "utm_medium": null,
      "utm_campaign": null,
      "utm_term": null,
      "utm_content": null,
      "roistat_param_1": null,
      "roistat_param_2": null,
      "roistat_param_3": null,
      "roistat_param_4": null,
      "roistat_param_5": null,
      "google_client_id": null,
      "source_level_1": "fb",
      "source_level_2": "new"

    Example of a handler that supplements the log:

    $data = json_decode(trim(file_get_contents('php://input')), true);
    file_put_contents('webhook-log.html', serialize($data) . '<br />', FILE_APPEND); // In $data will be array "key" => value with information about the letter described above

  4. Click the Save button.

(warning) Deals in CRM will be created only:

To substitute each additional address, place the following script between <body></body> tags in the code of your website page with substitute addresses:

    window.onRoistatModuleLoaded = function () {
               var mailElements = document.getElementsByClassName('myCustomMailClassHere'); // myCustomMailClassHere - class name of the element that contains substitute address 
               var email = "myAddress+"+roistat.visit+""; // myAddress - second substitute email addres until @ symbol, - domain of the substitute email address
               for (var i = 0; i < mailElements.length; i++) {
                   mailElements[i].innerHTML = email;
                   mailElements[i].src = "mailto:"+email;
				   mailElements[i].href = "mailto:"+email;

(warning) This script adds the visit number to the specified email address. For example,  address may be changed на, where 123 is a visit number.  

To receive all letters in CRM automatically, readdress the letters from all your addresses to one email. 

(warning) Please make sure that the e-mail provider of the address you specified in para 2 identifies e-mail addresses which contain + symbol as regular e-mail addresses. For example, address must be identified as If this option is not configured by default, set up the redirection from the address type to the address type

How to Browse Letters History

To browse the letters that are loaded to your Roistat project, click the History tab:

You will see the loaded letters in the table with the following columns:

(информация) The frequency of the letters list updating depends of the number of Roistat projects on the server. In average, letters list is updating every 3-15 minutes.