Loading...
Page tree
Skip to end of metadata
Go to start of metadata

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: 
    • By default, substitution email addresses are formed the following way: customer visits your website and automatically receives the visit number. Then this visit number is added to the real e-mail address specified by you in para 2. For example myemail+12345@example.com, where 12345 is a visit number.    
      (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 myemail+12345@example.com must be identified as myemail@example.com. If this option is not configured by default, set up the redirection from the address type myemail+12345@example.com to the address type myemail@example.com.  
    • Drag the Use own substitute addresses bar to the right and enter the addresses using a comma in the field below. Customers will see one of the substitute addresses you enter.
      After dragging the Use own substitute addresses bar to the right, you will see the recommended number of substitute e-mail address:


  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: 

<script>
window.onRoistatModuleLoaded = function () {
    window.roistat.emailtracking.enabled = false;
};
</script>

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_1@mail.com", // email from where the message came from
      "email_to": "email+123456@mail.com", // address the email was sent
      "attachments": [], // attached files
      "referrer": "fb.com", // landing page
      "marker": "fb_new", // visit source
      "city": "New York", // city
      "country": "USA", // country
      "ip": "161.185.160.93", // IP-address
      "first_visit": "1001", // first visit
      "domain": "test.com", // website domain
      "landing_page": "test.com/new", // 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:

    <?php
    $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:

  • for letters that have specified visit number;
  • for letters that were sent to the additionally configured substitution address. 
 Click here if you placed 2 or more different email addresses on your website

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

<script>
    window.onRoistatModuleLoaded = function () {
        roistat.registerOnVisitProcessedCallback(function(){
               var mailElements = document.getElementsByClassName('myCustomMailClassHere'); // myCustomMailClassHere - class name of the element that contains substitute address 
               var email = "myAddress+"+roistat.visit+"@myDomain.com"; // myAddress - second substitute email addres until @ symbol, @myDomain.com - 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;
               }
        });
    };
</script>

(warning) This script adds the visit number to the specified email address. For example,  address myemail@example.com may be changed на myemail+123@example.com, 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 myemail+12345@example.com must be identified as myemail@example.com. If this option is not configured by default, set up the redirection from the address type myemail+12345@example.com to the address type myemail@example.com

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:

  • Date - date and time of the letter;

  • Sender - sender address;

  • Receivers - receivers addresses;

  • Visit number - visit number from roistat_visit cookie;

  • Deal number - number of the deal from CRM (if you clicked the Send to CRM checkbox); 
    (информация) If a user sends the letter with the attached file, this file will be saved to Roistat server, and deal in CRM will receive a link to this file.

  • Theme - the subject of the letter;

  • Message - text of the letter.

(информация) 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. 

  • No labels