Setup Website for Email Open Tracking
Select email open tracking for an overview.
-> from the program main menu. Please seePlease replace mywebsite.com with your own website name.
Pixel Tag URL
This URL is automatically inserted into each email. The inserted line is the following:
Each email sent by BroadcastByEmail contains a unique id automatically generated for later tracking.
Statistics Query URL
This is the URL used to query opened emails. BroadcastByEmail calls the following to query opened emails.
Steps to setup your website and script
The following is an example for setting up your website for email open tracking. It assumes you have a relational database and PHP scripting support.
-
Copy or create the pixel tag image to your website
You can use the sample image found under:
, or you can use any image editing tool to create your own image. -
Setup your database
Your web site must be able to support a database. For example, most hosting companies have mysql databases. You need to create a table to contain the . But you can also include and . The following SQL statement creates a table named
# SQL
CREATE TABLE `opentracking` (
`eid` varchar(64) NOT NULL default '',
`ipaddr` varchar(16) NOT NULL default '',
`atime` timestamp(14) NOT NULL
) TYPE=MyISAM;
-
Copy or create the image access script to your website
The following is a simple example PHP script for the "get image" operation. You can use it directly if your website supports PHP scripting.
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$eid = $_GET['eid'];
$ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$db_conn = mysql_connect('hostname', 'user', 'passwd') or die ("Database CONNECT Error (line 11)");
$insert_st = "INSERT INTO opentracking values ('".$eid."', '".$ip."', now())";
mysql_db_query('databasename', $insert_st) or die ("Database failed to insert");
header("Location: onebyoneimage.jpg");
return;
?>Please replace
, , , and with the actual name you have.What this script does is whenever it is called, it gets the unique email id (eid) from the HTTP request, then inserts that access to the database. After that, it returns an image named onebyoneimage.jpg.
-
Copy or create the query open script to your website
The following is a simple example PHP script for query operation.
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// list of eids separated by comma
$eidstr=$_GET['eid'];
$eids = explode(",", $eidstr);
if (sizeof ($eids) == 0)
return;
$db_conn = mysql_connect('hostname', 'user', 'passwd') or die ("Database CONNECT Error (line 11)");
$retstr = '';
foreach ($eids as $eid) {
$query_st= "SELECT COUNT(*) from opentracking where eid = '".$eid."'";
$result = mysql_db_query('databasename', $query_st) or die ("Database failed to select");
$count = '0';
if (mysql_num_rows($result)) {
$qry = mysql_fetch_array ($result);
$count = $qry[0];
}
if ($retstr != '') {
$retstr .= ',';
$retstr .= $count;
}
echo $retstr;
return;
?>Please replace hostname, user, passwd, and databasename with the actual name you have.
What the script does is return the total access count for the eids provided. The eids are provided as a comma separated list. The return count is also returned as a comma separated list.