Conversion Tracking

Overview

You can track click-through data at a deeper level with ExactTarget's Conversions Tracking feature, which allows you to track the customer traffic and revenues generated by multiple links within your emails. By simply inserting the necessary tracking code into your web pages, you are able to test, read, and optimize traffic rates and revenues for various campaigns.

With the Conversions Tracking feature, you set up your ExactTarget email to contain a link to a landing page on your website. When a subscriber goes to that landing page via the email link, ExactTarget passes you data about the subscriber and the email so that you can keep track of this subscriber's activity on your website. You then can pass data about the subscriber's activity back to ExactTarget to be displayed along with the standard email tracking data.

Implementing the Conversions Tracking feature consists of following these steps, all of which are fully explained in this document:

  1. Set up the landing page on your website to accept a series of parameters from ExactTarget. ExactTarget will pass these parameters whenever a user clicks the link to this landing page in an ExactTarget email.

The landing page is the initial page on your website that the subscriber visits. The link that you include in the ExactTarget email takes the user to this page.

  1. Set up the landing page to pass these parameters to the conversions page or pages on your website.

The conversions page is the page on your website where you want to track the subscriber's activity. The subscriber jumps to the conversions page or pages from the landing page.

  1. Set up each of your conversions pages to accept these parameters, build an XML string containing the data you want to track, and pass the XML string to ExactTarget whenever the subscriber acts on the conversions page.

Tip: The Conversions Tracking feature also supports the direct submission of data from your client-side Adobe (formerly Macromedia) Flash applications, using ActionScript or Flex.

  1. Insert the properly configured link to your landing page into the ExactTarget email that you send to subscribers.

The code samples shown in this document are available in text file format for easier copying and pasting. The Code Samples section of this document contains the download link.

Setting Up Your Landing Page

When a subscriber clicks the landing page link in the ExactTarget email, ExactTarget passes the following parameters to your landing page:

Parameter Value
j Job ID (identifier of this email send)
e Subscriber email address
l (lowercase L) List ID
u ID of the landing page URL
jb Job batch ID
mid Your ExactTarget account number (member ID)

Your landing page must do the following:

  • Accept these parameter values from ExactTarget.
  • Either pass these parameter values to the conversions page that the subscriber visits next, or store the values in a cookie, where the conversions page will retrieve them.

The following sample syntax is an example of a link from the landing page to a conversions page in which the landing page is passing the parameters to the conversions page:

http://www.example.com/landing.asp?j=JobID&l=ListID&e=email&u=LinkID&jb=BatchID

(This example illustrates the syntax only and is not a functioning URL.)

See the landing page code samples.

Setting Up Your Conversions Pages

When a subscriber clicks through your landing page to a page where you want to capture data about the subscriber's activities (such as purchases made), that destination page-known as the conversions page-must do the following:

  • Either accept the ExactTarget parameter values from the landing page or retrieve these values from a cookie. (See the instructions for setting up your landing page.)
  • Build an XML string with the data you want to return to ExactTarget. Details on the parameters to pass appear in the next section.
  • Use an image tag to capture the conversion and return the XML string to ExactTarget. (This image tag can be added to any page on your website, to track hits from the landing page to other pages.) See information about this tag in the Image Tag section.

XML String

Use the following tags in the XML string, which your conversions page will return to ExactTarget:

XML Tag Tag Description
<action> Required tag that must contain the value conversion.
<BatchID> Required tag containing the triggered send batch ID, which was passed from ExactTarget to the landing page via the jb parameter. This tag is required for conversion tracking to work with interactions. This tag is optional but recommended if you are not using conversion tracking with interactions.
<conversion_link_id> Required tag containing a unique numeric identifier for this conversions page. Every conversions page that will be passing data to ExactTarget must be identified by a unique number.
<data>

Optional tag for passing transactional data about the subscriber's activity on the conversions page.

This tag must contain the following options, with the values enclosed in quotation marks:

  • Amt Numeric; the value of the transaction.
  • Unit Alphanumeric; the unit of measurement for this transaction.
  • Accumulate Boolean (true or false); whether the amt values should be accumulated.

Sample syntax for this tag:

       <data amt="100" unit="Dollars" accumulate="true"/>

<data_set> Wrapper for the optional set of <data> tags.
<display_order> Required tag containing a number that represents the order in which the conversions page will be displayed in the ExactTarget Conversions Tracking.
<email> Required tag containing the subscriber email address that was passed from ExactTarget to the landing page via the e parameter.
<job_id>

Required tag containing the job ID that was passed from ExactTarget to the landing page via the j parameter.

Refer to the ExactTarget application's online help documentation for information about job IDs.

<link_alias>

Required tag containing the name to be displayed in the ExactTarget tracking information for this conversions page.

Sample syntax for a conversions page that you want to identify as Products page:

      <link_alias>Products page</link_alias>

<list>

Required tag containing the list ID for this subscriber that was passed from ExactTarget to the landing page via the l parameter.

Refer to the ExactTarget application's online help documentation for information about list IDs.

<member_id> Required tag containing the member ID that was passed from ExactTarget to the landing page via the mid parameter.
<original_link_id> Optional tag containing the ID of the URL the subscriber clicked in the email, which was passed from ExactTarget to the landing page via the u parameter.
<system_name> Required tag that must contain the value tracking.

Here is an example of an XML string. (See the ASP code sample, which would produce this string.)

Note: Be sure to eliminate any extra spaces from the XML string. No spaces should appear between XML tags or between an element start tag and end tag. See the Image Tag section for more details on how to pass this XML string to ExactTarget.

<system>
    <system_name>tracking</system_name> 
    <action>conversion</action>
    <member_id>20496</member_id> 
    <job_id>162951</job_id> 
    <email>bob@hotmail.com</email> 
    <list>84560_HTML</list> 
    <original_link_id>3531372</original_link_id> 
    <BatchID>36</BatchID> 
    <conversion_link_id>1</conversion_link_id> 
    <link_alias>Tennis Ball Product Display Page</link_alias> 
    <display_order>3</display_order> 
    <data_set> <data amt="100" unit="Dollars" accumulate="true"/>    </data_set> 
</system>

Image Tag

To track hits to your conversions page, you add the image tag to those pages. Additionally, you can insert the image tag on any other page you want to track as well (pages to which a user has navigated from links in your email or on your landing pages).

Be sure to include the image tag only if the user who has navigated to the page entered your site through the ExactTarget email link. For an example, see the IF condition in the ASP sample code.

Here is the basic syntax to use for your image tag:

<img src='http://click.ExactTarget.com/conversion.aspx?xml=[Your XML Statement Here]' width="1" height="1">

Example with No Transactional Data Included

Here is an example of simply recording that a subscriber visited the conversions page, with no additional data passed in the <data_set> tags:

<img src = 
'http://click.exacttarget.com/conversion.aspx?xml=<system><system_name>tracking</system_name><action>conversion</action><member_id>20496</member_id> 
<job_id>13919</job_id><email>joe@fictitiousdomain.com</email><list>11456_HTML</list>
<original_link_id>137476 </original_link_id><BatchID>36</BatchID>
<conversion_link_id>2</conversion_link_id><link_alias>KayakPage </link_alias>
<display_order>2</display_order><data_set></data_set></system>' width = "1" height ="1">

Example with Transactional Data

This example includes transactional data recorded on the conversions page.

Note: Because the <data> tag values include quotation marks, be sure to enclose the URL in single quotes (apostrophes).

<img src = 
'http://click.exacttarget.com/conversion.aspx?xml=<system><system_name>tracking</system_name>
<action>conversion</action><member_id>20496</member_id> <job_id>13919</job_id>
<email>joe@fictitiousdomain.com</email><list>11456_HTML</list><original_link_id>137476 </original_link_id><BatchID>36</BatchID><conversion_link_id>2</conversion_link_id><link_alias>KayakPage </link_alias>
<display_order>2</display_order>
<data_set><data amt="6.55" unit="Dollars" accumulate="true"/><data amt="1.0" unit="Number of Roses" accumulate="true"/><data amt="1.0" unit="Number of Lilacs" accumulate="true"/></data_set></system>' width = "1" height ="1">

Inserting the Link in Your ExactTarget Email

In order for ExactTarget to pass parameters to your landing page, the landing page hyperlink must be designated a conversion tracking link when inserted into the ExactTarget email. The example below shows how to construct that link and what a sample link looks like:

j=%%jobid%%&l=%%listid%%&e=%%emailaddr%%&u=%%JobURLID%%&jb=%%_JobSubscriberBatchID%% 
http://www.example.com/?j=59959959&e=jdoe@example.com&l=4454454_HTML&u=193635789&jb=0

The user creating the email must select the Conversion Tracking Link checkbox in the Insert Link dialog box when inserting the landing page hyperlink in the email. For details on creating emails and hyperlinks in emails, refer to the ExactTarget application's online help documentation.

For an HTML paste email, the user creating the email must add a conversion="true" attribute to the HREF link, as shown in this example:

<a href="http://www.northerntrail.com/productlist.asp" 
conversion="true">www.northerntrail.com/productlist.asp</a>

Conversions Display in ExactTarget

For user-initiated email sends, the data that your conversions page passes to ExactTarget appears in the Conversions summary of the email send's tracking page in the ExactTarget application.

Note: Conversion tracking data is not passed down in tracking details from the Enterprise account to On Your Behalf accounts.

For triggered email sends, tracking information is available:

  • On the Interactions tab via the triggered send definition. The data that your conversions page passes to ExactTarget appears in the Conversions Activity section.
  • On the Tracking tab in the Triggered Email Sends folder. The data appears in the Conversions summary section.

Code Samples

The following sections provide ASP and PHP samples of the code you will need to add to your landing and conversions pages.

These samples are also available in text files that you can download in a zipped file from this link: http://memberlandingpages.com/help/conversiontracking/ConversionTrackingCodeSamples.zip

ASP Examples

The following sections show ASP examples of landing and conversions page code.

Landing Page Sample: Capturing Parameters from ExactTarget

<% 
DIM JobID, EmailAddr, ListId, UrlID, strXML 
JobID = Request ("j") 
EmailAddr = Request("e") 
ListID = Request("l") 
BatchID = Request("jb") 
UrlID = Request("u")
MemberID = Request("mid") 
%>

Landing Page Sample: Storing the ExactTarget Parameters in a Cookie

<% 
DIM JobID, EmailAddr, ListId, UrlID, strXML 
JobID = Request ("j") 
EmailAddr = Request("e") 
ListID = Request("l") 
BatchID = Request("jb") 
UrlID = Request("u") 
ExpireDays = 21 
 
Response.Cookies("NorthernTrail")("JobId") = trim(JobID) 
Response.Cookies("NorthernTrail")("EmailAddr") = trim(EmailAddr) 
Response.Cookies("NorthernTrail")("ListID") = trim(ListID) 
Response.Cookies("NorthernTrail")("BatchID") = trim(BatchID) 
Response.Cookies("NorthernTrail")("UrlID") = trim(URLID) 
Response.Cookies("NorthernTrail")("MemberID") = trim(MemberID) 
Response.Cookies("NorthernTrail").Expires = Date() + ExpireDays 
Response.Cookies("NorthernTrail").Domain= "www.northerntrailoutfitters.com" 
%>

Landing Page Sample: Retrieving the ExactTarget Parameters from a Cookie

<% DIM JobID, EmailAddr, ListID, BatchID, URLID, strXML 
JobId = Request.Cookies("NorthernTrail")("JobId") 
EmailAddr = Request.Cookies("NorthernTrail")("EmailAddr") 
ListId = Request.Cookies("NorthernTrail")("ListID") 
BatchID = Request.Cookies("NorthernTrail")("BatchID") 
URLID = Request.Cookies("NorthernTrail")("UrlID") 
Memberid = Request.Cookies("NorthernTrail")("MemberID") 
%>

Conversions Page Sample: Retrieving the ExactTarget Parameters and Passing the XML String to ExactTarget

<% 
DIM JobID, EmailAddr, ListId, BatchID, UrlID, strXML 
 
JobID = Request ("j") 
EmailAddr = Request("e") 
ListID = Request("l") 
BatchID = Request("jb") 
UrlID = Request("u") 
strXML = 
"<system><system_name>tracking</system_name><action>conversion</action>" _ 
& "<member_id>" & trim(MemberID) & "</member_id>" _ 
& "<job_id>" & trim(jobID) & "</job_id><email>" & trim(emailaddr) 
& "</email>"_ 
& "<list>"& trim(ListID) &"</list><original_link_id>"& 
trim(URLId) & "</original_link_id>"_ 
& "<BatchID>"&trim(BatchID)&"</BatchID>"_ 
& "<conversion_link_id>2</conversion_link_id>"_ 
& "<link_alias>Kayak 
Page</link_alias><display_order>2</display_order>"_ 
&"<data_set></data_set>"_ 
&"</system>"%> 
<head> 
<!-- Your HTML here --> 
</head> 
<body> 
 
<!-- Your HTML here --> 
 
<% if JobID <> "" and ListID <> "" and EmailAddr <> "" and URLid <> "" then %> 
<img src = 'http://click.exacttarget.com/conversion.aspx?xml=<%=strXML%>' width = "1" height ="1"> 
<% end if %> 
 
<!-- Your HTML here --> 
</body>

JavaScript Examples

The following sections show JavaScript examples of landing and conversions page code.

Landing Page Sample

<html> 
<head> 
<title>Set Tracking Cookie</title> 
<script language="javascript"> 
//Set the number of days before your cookie should expire 
 
var ExpireDays = 90; 
 
//Do not change anything below this line q
 
    str = document.location.search; 
    qstr = qstr.substring(1,qstr.length) 
 
    function SetCookie(cookieName,cookieValue,nDays) 
    { 
        var today = new Date(); 
        var expire = new Date(); 
        if (nDays==null || nDays==0) nDays=1; 
        expire.setTime(today.getTime() + 3600000*24*nDays); 
        document.cookie = cookieName+"="+escape(cookieValue)+ 
";expires="+expire.toGMTString(); 
    } 
 
thevars = qstr.split("&"); 
    for(i=0;i<thevars.length;i++) 
    { 
        switch(thevars[i]) 
        { 
            case "e": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("EmailAddr",e,ExpireDays); 
                break; 
            case "j": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("JobID",j,ExpireDays); 
                break; 
            case "l": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("ListID",l,ExpireDays); 
                break
            case "jb": 
                thevars[i] = thevars[i].replace("=","='")+"'";
                eval(thevars[i]); 
                SetCookie("BatchID",jb,ExpireDays); 
                break; 
            case "u": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("UrlID",u,ExpireDays); 
                break; 
            case "mid": 
                thevars[i] = thevars[i].replace("=","='")+"'"; 
                eval(thevars[i]); 
                SetCookie("MemberID",mid,ExpireDays); 
                break; 
            default: 
                eval(thevars[i]); 
                break; 
        } 
    } 
</script> 
</head> 
<body> 
<a href="conversion.html">Conversion Page</a> 
</body> 
</html>

Conversions Page Sample

<html>  <head>  <title>Conversion</title>  </head>  <body>  <!-- Put your HTML Body Here -->    <!-- ExactTarget Conversion Tracking Script Here-->  <script language="javascript">  //Set the following parameters for your conversion parameters    var convid="1";  var displayorder="1";  var linkalias="My Link Name";    var dataset="<data amt=\"1\" unit=\"Downloads\" accumulate=\"true\" />";  //For additional datasets, simply add them to the concatenation:  //dataset=dataset+"<data amt=\"1\" unit=\"Dollars\" accumulate=\"true\">    //Do not change anything below    function getCookie(cookiename){      if(document.cookie.length >0) {          startC = document.cookie.indexOf(cookiename+"=");          if (startC != -1) {              startC += cookiename.length+1;              endC = document.cookie.indexOf(";",startC);              if(endC ==-1) endC = document.cookie.length;                  return unescape(document.cookie.substring(startC,  endC));                  }              }          return null;      }   var jobid = getCookie("JobID");  var emailaddr = getCookie("EmailAddr");  var listid = getCookie("ListID");  var batchid = getCookie("BatchID");  var urlid = getCookie("UrlID");  var memberid = getCookie("MemberID");   //Debug  //document.write("<textarea rows=5 cols=80>");  document.write("<img src='");  document.write('http://click.exacttarget.com/conversion.aspx?xml=<system><system_name>tracking</system_name><action>conversion</action>');  document.write("<member_id>"+memberid+"</member_id>");  document.write("<job_id>"+jobid+"</job_id>");  document.write("<email>"+emailaddr+"</email>");  document.write("<list>"+listid+"</list>");  document.write("<BatchID>"+batchid+"</BatchID>");  document.write("<original_link_id>"+urlid+"</original_link_id>");  document.write("<conversion_link_id>"+convid+"</conversion_link_id>");  document.write("<link_alias>"+linkalias+"</link_alias>"); document.write("<display_order>"+displayorder+"</display_order>");  document.write("<data_set>"+dataset+"</data_set>");  document.write("</system>'");  document.write(" width='1' height='1'>");  //Debug  //document.write("</textarea>");  </script>  </body>  </html>

PHP Examples

The following sections show PHP examples of landing and conversions page code.

Landing Page Sample

<?php 
 
$JobID = $_GET['j']; 
$SubscriberID = $_GET['e']; 
$ListID = $_GET['l']; 
$BatchID = $_GET['jb']; 
$UrlID = $_GET['u']; 
$MemberID = $_GET['Mid']; 
 
setcookie('JobID', $JobID); 
setcookie('SubscriberID', $SubscriberID); 
setcookie('ListID', $ListID); 
setcookie('BatchID', $BatchID); 
setcookie('UrlID', $UrlID); 
setcookie('MemberID', $MemberID); 
 
?> 
<html> 
<head> 
<title>Landing Page</title> 
</head> 
<body> 
<a href="http://us3.php.net/variables.predefined">Info on predefined variables</a><br /> 
<a href="http://us2.php.net/setcookie">Info on setting cookies</a><br /> 
<a href="confirm.php">Confirm Page</a> 
</body> 
 
</html>

Conversions Page Sample 

<?php 
//This code should be on any confirmation page after the conversion is made. 
//Refer to the Conversion Tracking Guide for customization. 

$debug = 'off'; 
$JobID = $_COOKIE['JobID']; 
$SubscriberID = $_COOKIE['SubscriberID']; 
$ListID = $_COOKIE['ListID']; $BatchID = $_COOKIE['BatchID']; 
$UrlID = $_COOKIE['UrlID']; 
$MemberID = $_COOKIE['MemberID']; 

    //Refer to the Conversion Guide on customizing the data within this XML to display the proper conversion 
    //information within {{ wiki.template('ProductName') }}

    $strTP = '<img src=\'http://click.{{ wiki.template('ProductName') }}.com/conversion.aspx?xml='; 
    $strTP .= '<system><system_name>tracking</system_name><action>conversion</action>'; 
    $strTP .= '<member_id>'.$MemberID.'</member_id>'; 
    $strTP .= '<job_id>'.$JobID.'</job_id><email>'.$SubscriberID.'</email>'; 
    $strTP .= '<list>'.$ListID.'</list><BatchID>'.$BatchID.'</BatchID>'; 
    $strTP .= '<original_link_id>'.$UrlID.'</original_link_id>'; 
    $strTP .= '<conversion_link_id>1</conversion_link_id>'; 
    $strTP .= '<link_alias>Alias</link_alias><display_order>1</display_order>'; 
    $strTP .= '<data_set>'; $strTP .= '<data amt="100" unit="Dollars" accumulate="true" />'; 
    $strTP .= '</data_set></system>\''; 
    $strTP .= ' width="1" height="1">'; 

    if ($debug=='on'){ 
        $strTP = '<textarea rows=10 cols=50>'.$strTP.'<textarea>'; 
    } 

?> 
<html> 
<head> 
<title>Conversion Page</title> 
</head> 
<body>
Your Confirmation Page 

<br /><? print $strTP; ?> 
</body> 
</html>


 


Was This Page Helpful

Yes No
Suggestion:

Please enter your email or phone, if you would like us to contact you:

Enter the digits 27495 backwards:

Tag page
You must login to post a comment.