|
|
Conversion TrackingFrom $1Table of contents
OverviewYou 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 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:
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.
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.
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.
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 PageWhen a subscriber clicks the landing page link in the ExactTarget email, ExactTarget passes the following parameters to your landing page:
Your landing page must do the following:
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&mid=MemberID (This example illustrates the syntax only and is not a functioning URL.) See the landing page code samples. Setting Up Your Conversions PagesWhen 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:
XML StringUse the following tags in the XML string, which your conversions page will return to ExactTarget:
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>help@example.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 TagTo 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"> If you use the S4 instance for your ExactTarget account, use the string click.s4.exacttarget.com instead of click.exacttarget.com at the beginning of all of the examples contained on this page. If you use the S6 instance for your ExactTarget account, use the string click.s6.exacttarget.com instead of click.exacttarget.com. Example with No Transactional Data IncludedHere 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 DataThis 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 EmailIn 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 ExactTargetFor 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:
Code SamplesThe 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 ExamplesThe following sections show ASP examples of landing and conversions page code. Landing Page Sample: Capturing Parameters from ExactTarget<%
DIM JobID, EmailAddr, ListId, UrlID, MemberID, 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, MemberID, 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, MemberID, 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, MemberID, 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 ExamplesThe 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++)
{
cookiecase = the vars[i].split("=");
switch(cookiecase[0])
{
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:
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 ExamplesThe 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.exacttarget.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>
This page was last updated by Adam Evans on Thu, 02 Feb 2012 15:50:43 GMT. If you require assistance with the ExactTarget application, please contact Global Support. If you wish to send Adam direct feedback, fill out the form below:
Tags: (Edit tags)
|
||||||||||||||||||||||||||||||||||||||||||
Powered by MindTouch 2010 |