Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.
/ emma Public archive

Emma is a bot that predicts the performance of Salesforce email marketing campaigns.

Notifications You must be signed in to change notification settings

scottanthonymurray/emma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Emma

Emma is a bot that predicts the performance of Salesforce email marketing campaigns.

Training Emma

Emma uses the k-nearest neighbors machine learning algorithm to make predictions about the performance of email campaigns.

To train Emma, create a new instance of Emma and pass to the constructor the path to your Salesforce tracking data spreadsheet. The path to your tracking data spreadsheet is relative to the directory in which Emma lives.

$emma = new Emma\Emma('salesforce_tracking_data.csv');

Exporting Salesforce training data

Emma uses the .csv spreadsheet generated by Salesforce Marketing Cloud's Recent Send Summary Report.

You'll need to export your tracking data from Salesforce and save the spreadsheet to a folder on your computer or web host that can be read by Emma.

Configuring PHP to read tracking data spreadsheets

Before using Emma, you'll need to tell PHP to automatically detect line endings in spreadsheets—otherwise, the data may not be read correctly.

You'll also need to set the timezone to America/Indiana/Indianapolis to ensure Salesforce timestamps are processed correctly.

ini_set('auto_detect_line_endings', true);
date_default_timezone_set('America/Indiana/Indianapolis');

Predicting the performance of an email campaign

Emma's predict method can be used to predict the performance of an email campaign.

The predict method takes 3 arguments:

  • $segment_size: An integer representing the number of people to which the email campaign will be sent.
  • $day_of_week: An integer between 0 (Sunday) and 6 (Saturday) representing the day of the week on which the email campaign will be sent.
  • $hour_of_day: An integer between 0 and 23 representing the hour of the day on which the email campaign will be sent.
$segment_size = 600;
$day_of_week = 3;
$hour_of_day = 15;

$prediction = $emma->predict($segment_size, $day_of_week, $hour_of_day);

The predict method returns an array containing two decimal values: the predicted open rate percentage and the predicted click-through rate percentage. Values are rounded to the nearest hundredth.

[51.52, 8.59]

Limitations and room for improvement

  • Emma requires a training data set containing hundreds (if not thousands) of email campaigns before it's able to make reasonably-accurate predictions.
  • Emma doesn't account for other aspects of an email campaign that affect its performance, including subject line and message copy, content length, number of images in the message, or number of previous sends in the campaign.
  • Emma doesn't account for audience demographic information (ex. prospective students, alumni, faculty and staff).
  • Emma might be more accurate using a different machine learning algorithm, or different data pre-processing steps such as applying one-hot encoding to the hour_of_day and day_of_week features.

About

Emma is a bot that predicts the performance of Salesforce email marketing campaigns.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages