Skip to content

Marketing Automation

General Information

Marketing Automation is a tool to improve customer relationships based on automatic events. You can set such events as: sending an email to the client, a notification in Slack or assigning a task to a manager if a certain condition regarding the client is met.

Creating a Script

To create a new script, go to the Marketing AutomationScripts page and click on Add scenario button:

1.png

Each script consists of 3 parts: Event, Conditions and Action:

2.png

Event

An event is something that will be tracked by clients within a script. The following types of events are available:

  • New visit. As part of this event, new user visits to your sites are tracked.

    The event is triggered by processing a new user visit to Roistat. Estimated time: 5-10 minutes.

  • New deal. As part of this event deals that are loaded for the first time into your Roistat project are tracked.

  • Deal status change. The event tracks the change in the status of a transaction among transactions loaded into Roistat.
  • X days have passed since deal creation. As part of this event, transactions that have already been loaded into the Roistat project are tracked.
  • X days have passed since the deal was closed. As part of this event transactions that are recorded as sales in the Roistat project are tracked.
  • Custom event. As part of this event, you can customize the conditions for handling events configured in the corresponding section.

Conditions

All events that were selected in the previous step within the script are checked for the conditions set. You can add one or more conditions. Several conditions are associated with the conditional operator "AND". That is, for the script to execute the event must satisfy all conditions. It is also possible to create a script without conditions; In this case, the script will be triggered by all the events specified in the first step.

Some conditions are tied to specific events, below is a table of all existing conditions:

For the conditional operator "Any of" it is necessary to enter the values separated by commas.

Condition Operators Available events Additional info
  • Visitor's city name
  • Visitor's country name
  • IP address of the visitor
  • Referrer page, from which the user cam to your website
  • Domain name
  • Landing page
  • Source
  • UTM tags values
  • roistat_param tags values
  • Equals
  • Any of
  • Contains
  • Doesn't contain
  • New visit
  • New deal
  • Deal status change
  • X days passed since deal creation
  • X days passed since the deal was closed
  • Custom event
This group of conditions uses the visitor's data
Number of deals
  • Equals
  • Greater than
  • Lesser than
  • New visit
  • New deal
  • Deal status change
  • X days passed since deal creation
  • X days passed since the deal was closed
  • Custom event
The condition uses data from the first visit of the user.
Deal status
  • Equals
  • Any of
  • Contains
  • Doesn't contain
  • New deal
  • Deal status change
  • X days passed since deal creation
  • X days passed since the deal was closed
The condition checks the deal status in the CRM system
Additional fields from CRM system
  • Equals
  • Any of
  • Contains
  • Doesn't contain
  • New deal
  • Deal status change
  • X days passed since deal creation
  • X days passed since the deal was closed
The condition checks additional field values in the CRM system
Event name
  • Equals
  • Any of
  • Contains
  • Doesn't contain
Custom event The condition checks that a specific event has occurred

Action

If the event selected in the first step satisfies the conditions selected in the second, one of the following actions will be performed, which is configured in this step.

Using dynamic variables

In all texts, you can use dynamic variables that will change their value in each particular case, the full list below:

Variable name Value
{visit_id} Visit ID
{visit_ip} IP address of the visit
{visit_marker} Visit source (marker)
{visit_city} City of visit
{visit_country} Country of visit
{visit_referrer} Referrer page of the visit
{visit_domain} Website domain
{visit_landing_page} Landing page
{visit_utm_source} utm_source tag value
{visit_utm_medium} utm_medium tag value
{visit_utm_campaign} utm_campaign tag value
{visit_utm_term} utm_term tag value
{visit_utm_content} utm_content tag value
{visit_roistat_param_1} roistat_param1 parameter value
{visit_roistat_param_2} roistat_param2 parameter value
{visit_roistat_param_3} roistat_param3 parameter value
{visit_roistat_param_4} roistat_param4 parameter value
{visit_roistat_param_5} roistat_param5 parameter value
{client_external_id} Client ID in the CRM system
{client_name} Client name
{client_company} Client company name
{client_phone} Client phone number
{client_email} Client email
{order_id} Order ID in the CRM system
{order_price} Revenue (amount) of the order
{order_cost} Order cost
{order_status} Deal (order) status in the CRM
{event_id} ID of event execution
{event_meta_id} ID of event that was executed
{event_data} Data about the event that was executed

Please note:

All variables are subject to the following restriction: if at the moment the script triggers in Roistat there is no information about the client, order, etc., then a dynamic variable itself will be sent to the notification instead of the value.

Sending a notification to Slack

You can send a notification to a specific channel in Slack. To configure, specify the notification text and webhook of your channel. You can get a webhook according to this instruction.

Sending an email to the user

After the event was executed, you can send an email to the client.

In order for the email to be sent, the client must be uploaded to Roistat and have a contact email address.

Configuration:

  • Specify the subject of the email. The subject of the email will appear in the header of the email that the client will see.
  • Specify the SMTP server from which emails will be sent.
  • Specify the port of your server. For example, for yandex it is 465.
  • Specify one or more users (mailboxes) separated by commas. They will send letters to customers. If multiple mailboxes are specified, letters will be sent from the mailboxes in turn.
  • Specify the password from the mail user. If multiple email users are used, they must have the same password.
  • Specify the text of the letter. This field supports both plain text and HTML layout, with which you can design unique special offers to your customers.

Webhook

You can set up sending webhook notifications. To configure, specify the address where the webhuk will be sent.

Data format:

{
    "event_type": "order_created",
    "script_id": "19",
    "script_name": "New deal",
    "visit": {
        "id": "12345",
        "ip": "123.45.67.89",
        "marker": "test_page_post",
        "city": "Moscow",
        "country": "Russia",
        "referrer": "testpage.com",
        "domain": "site.com",
        "landing_page": "site.com/test/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
    },
    "order": {
        "id": "100",
        "price": 120,
        "cost": 100,
        "status": "New"
    },
    "client": {
        "external_id": "2",
        "name": "Test Client",
        "company": null,
        "phone": "79012223344",
        "email": "test@client.com"
    }
}