Setting Up SendinBlue Automation on your website

Now that you have an overview of the incredible potential of SendinBlue Automation, it is time to actually set up the tool. Before you can create your first workflows, you will need to do some initial configuration. This may take a while, depending on your requirements. In most cases, the initial set-up only takes a few minutes. You just have to copy and paste a script into your website source code. The reason for inserting this script into your website is to send the Automation tool information about your visitors’ actions, so you can use this information for the start point/conditions of your workflows.

Understanding how it works - 3 levels of configuration

1. Main script

Configuring the main script is the only required step in setting up the Automation tool.

This script works in the same way as Google Analytics: as soon as a visitor loads a new page, the script sends this information to SendinBlue Automation. However, there is an important difference between the SendinBlue script and Google Analytics. The SendinBlue script will only function with "identified" visitors, i.e. those for whom you have an email address.

Next we will look at how to identify visitors to your website. Retrieving the main script could not be easier. The first time you launch SendinBlue Automation, the set-up wizard will display the script that you need to copy and paste into all the pages of your website. We recommend that you insert the script into your website header, just in front of the "header" tag.

You can find this script again at any time using the Advanced/Settings menu. This script is the same for all SendinBlue users except for the "client_key" parameter, which is unique to every SendinBlue account.


sendinblue automation script

2. Identifying visitors

The main script used in SendinBlue Automation will only function with identified visitors. How does it work? There are two ways of identifying visitors to your website. The first involves identifying your SendinBlue contacts from among your visitors. This method uses a cookie and is automatic, which means it can identify all visitors who have clicked at least once in one of your emails. The second method uses the Identify function from your website to identify visitors who have completed an email field on your site (e.g. after subscribing or logging on).

Identification using cookies

By default, SendinBlue will associate your contacts with a cookie as soon as they click on a link in an email sent by SendinBlue (transactional email or newsletter). When one of these contacts returns to your website, they are automatically identified and all of their actions, in particular the pages they visit, are recorded by SendinBlue Automation. This is a very effective method of identifying all of your customers/users, particularly on websites that have set up a subscription process with double opt-in, i.e. a confirmation link on which all users must click to confirm their subscription. However, this method has two limitations. The first limitation is that not everyone who visits your site will have clicked on one of your emails beforehand, even though you do actually have the email addresses of some of them. The second limitation is that using cookies as an identification method does not allow SendinBlue Automation to save specific information about the user.

For example, let’s assume that a particular visitor is registered as an "individual" and not as a "company". It would be useful for SendinBlue Automation to have this information so you can build a workflow that sends different confirmation emails.

Identification using the Identify function

To identify users who have not clicked in one of your emails and to obtain the maximum amount of information about them, you will need to use the Identify function. The principle is simple: as soon as a visitor enters an email address into your website, you can insert a script that will send the contact’s email address and potentially other information to SendinBlue Automation. The Identify function comprises two arguments:

  • an email ID, which is a mandatory parameter,
  • a list of information (JSON object) in which you can list any properties you choose.

sendinblue.identify ('james@example.com ', { 'Nom': 'James Clear ', 'Id': '10001', 'Mobile': '+12025550153', 'Plan': 'Diamond', 'Location': 'San Francisco' });

This function allows the user 'james@example.com’ to be identified and certain information to be linked to him: name, ID, mobile, plan and location. Of course, you can include as many properties as you like in the Identify Function.

3. Visitor actions: events, links and pages

The general script and use of the Identify function are enough to build workflows based on the pages visited or on information provided during subscription. However, you can configure SendinBlue Automation to gather more specific information about the behavior of users who visit the website. There are many different examples: sending a specific email based on the type of product purchased, sending an email after a PDF has been downloaded, etc. SendinBlue Automation gives you access to three functions that will send any information you may need to the SendinBlue platform to build all types of workflows.

Tracking events

This is the tool you will probably need the most. You can use the "Track" function to send an event to SendinBlue Automation – for example, a product purchase – along with certain attributes: product category, product name, special offer, price, etc. You can then use all this information to build a workflow, e.g. to send a series of emails to everyone who bought a product from category A that cost more than €100. The "Track" function works on the same principle as the "Identify” function. There is an initial required parameter - the event name - and a second parameter that includes a set of optional attributes, usually the event characteristics.

sendinblue.track('product_purchased', {
'product': 'A',
'amount': '100'
});

So, the above code allows you to send product purchase information to SendinBlue Automation with two characteristics: the product name and price. Technical documentation on the Track Event function

Tracking (virtual) pages

The main script used by SendinBlue Automation sends the pages visited by identified contacts. In some cases, e.g. if a pop-up appears or a form is completed in several steps and the URL does not change, no visited pages are returned. However, you may wish to record these actions as pages visited. For those who know Google Analytics well, this works in a similar way to virtual pageviews. In this type of situation, you can use the “Page” function to send a visited new page.

sendinblue.page('homepage', {
'title' : 'My Home Page',
'url' : 'http://www.example.com/home',
'path' : '/home'
})

The Page function comprises an initial parameter that corresponds to the name of the page – "homepage" in the example shown above – and a second parameter that is a set of properties, including "title", "URL" and "path". These 3 properties are not mandatory but if you do not specify them, the values from the general script will be used, which is not usually the primary objective. Technical documentation on the Track Page function

Tracking links

To track clicks that do not generate visited new pages, you have a third tool: the "trackLink" function. A typical example is when a PDF is downloaded. You could use an event in most cases, and this is what we recommend to all SendinBlue Automation users who do not have programming skills. The trackLink function provides a technical benefit: the initial parameter is not a name to be specified each time (as with events), but the DOM element clicked on. Technical documentation on the TrackLink function

From your tracking plan to your first workflows

1. Setting up a tracking plan

To make the most of the incredible potential of SendinBlue Automation, you should do more than simply setting up the main script. Using the Identify function when you have identified users on your website allows you to increase the number of identified contacts that could become the target of your workflows. In addition, sending specific events to SendinBlue Automation gives you valuable information about your contacts - information that could become the start point or conditions of your workflows.

To quickly set up a relevant and complete tracking system, we recommend that you create a summary table containing all the identifications/actions that you want to send to SendinBlue Automation. For example, the table could look something like this:

 

Function Where to put the code 1st parameter 2nd parameter
General script Header – All pages N/A N/A
Identify Newsletter subscription $email  
Identify User login $name, $postal_code  
Identify Account creation $email $name, $postal_code
Event Click on the Add to Basket button add_basket $category, $product, $price
Event Purchase confirmation page product_purchased $category, $product, $price
Page Form - steps 1 to 3 Form$step where $step is worth 1, 2 or 3 'title' : 'Form$step', 'url' : 'http://www.example.com/ Form$step ', 'path' : '/ Form$step' 

2. Validating tracking

Once your technical team has set up the different scripts on your website, the validation phase can then begin. The aim is simply to check that all the information (identifications, events, pages, etc.) that should be returned to SendinBlue Automation is actually sent. To do this easily, we suggest you use the Logs/Events report, which displays all the sent data.

3. Setting up your workflows

Now you have everything you need to build your first workflows. The start point for your workflows can be the identification of a contact, a visited page or a specific event, and you can use all the attributes you have sent to create conditions within your workflows and personalize your emails.