Add analytics

Introduction

In this example, we are going to extend the travel catalog showcase.

We are going to create an analytics dashboard that will be composed of two rows.

The first one will show information about the emails that were sent to the customer: number of bounces, delivered emails and how many have been opened.

The second one will display the number of customers who have applied for the first and the second offer.

These are the steps that are going to be covered:

  1. Install and configure the needed app
  2. Design our templates and contents
  3. Create and configure report
  4. Extend the flow
  5. View statistics

Install and configure the needed app

We need to install and configure the Analytics tool.

For further information on how to install an app, please refer to this page.

Design our templates and contents

For this example, we have extended the offer1 and the offer2 templates in order to have a submit button. You can download the files here.

These two pages will call our hosted page webhook upon submission.

If you need more information about the attributes that are used in these templates, please refer to this link.

Create and configure report

Now we need to configure the report in which we will display our analytics. To do so, we go to the reports overview and we click on the “New Report” button:

This will show the following pop-up:

We basically enter the name of our report and click on the “Save” button. This will take us to the report view where we are going to add and configure our charts for displaying the analytics.

The final result should look as follows:

The configuration of these charts is listed below:

 Bounces

  • Chart Type: Counter
  • Title: Bounces
  • Size: 4 (Large)
  • Auto refresh: 30 seconds
  • Background color: Red
  • Analytics name: email_status
  • Metrics:
    Name Legend text
    bounce Email bounce
  • Select Metric Values: Sum all the metric values to be calculated.

Delivered

  • Chart Type: Counter
  • Title: Delivered
  • Size: 4 (Large)
  • Auto refresh: 30 seconds
  • Background color: Green
  • Analytics name: email_status
  • Metrics:
    Name Legend text
    delivered Email delivered
  • Select Metric Values: Sum all the metric values to be calculated.

Opened

  • Chart Type: Counter
  • Title: Opened
  • Size: 4 (Large)
  • Auto refresh: 30 seconds
  • Background color: Orange
  • Analytics name: email_status
  • Metrics:
    Name Legend text
    opened Email opened
  • Select Metric Values: Sum all the metric values to be calculated.

Offers

  • Chart Type: Column
  • Title: Offers
  • Size: 12 (Full width)
  • Background color: Orange
  • Analytics name: offer_status
  • Metrics:
    Name Legend text
    offer1 Offer 1
    offer2 Offer 2
  • Select Metric Values: Sum all the metric values to be calculated.

Extend the flow

The last thing that we need to configure is the flow that we are going to use for testing our analytics dashboard.

As you may have noticed, we have added three instances of the Megamail webhook and one hosted page webhook. In this case, we have made them persistent cause we want them to be listening to new webhook responses all the time until the flow ends.

This is the configuration of each flow object that includes analytics:

Send confirmation

This one is configured in the Analytics tab. This will be performed when the customer applies for one of the offers by clicking on the submit button.

In this case, our variable @data.offer_chosen@ will contain either offer1 or offer2.

Opened +1

This will be performed when the email is opened by the customer in his email client.

Bounce +1

This will be performed if the email cannot be delivered.

Sent +1

This will be performed once the email has been successfully sent to the customer.

If you need more information on how to create a flow, please visit this link.

Well done! Now you have an analytics flow fully set up.

View statistics

For viewing the statistics, we simply visit the dashboard URL on any browser.

This URL is available in the report overview and looks like https://platform_url/v1/analytics-dashboard/45425342378947489524djgfa034547233487123481297.