Setup : Post-click tracking (Standard)
Configuring Post-click tracking is a two stage process, involving the email message and your website.
Standard Setup : JavaScript
(i.e. OnClick events)
1. Email Message
- First create a special tracked link in the email message:
<a href="http://www.foo.com/salespage.html?_pureTrackingName=FOOSALES"> SHOPPING PAGE </a>
The URL parameter (_pureTrackingName) will be obscured in the users browser address bar. Essentially this is a trigger that tells the platform to create a cookie when a recipient clicks through the link in the email. You should choose an appropriate name to use that will identify you and your tracked process. This prevents problems with recipients that receive multiple tracked emails from Response and clickthe links within the same browser session. Consider concatenating your profile name with the process (i.e. profile is FOO, process is SALES or QUOTES etc.)
2. Website
Ensure that your web server (URL REWRITE) is configured to allow incoming URL parameters, you can test this by navigating to your site with a test parameter.
"http://www.yoursite.com/home.html?a=1"
If the page accepts URL parameters the "?a=1" will remain in the address bar.
- Download and extract the Code Sample
- There is a JavaScript file in this archive that creates and manages a cookie in the recipients browser session. As well as holding a trackPage function
- Include this file on all destination pages (link addresses in the email campaign) that you'd like to track on your site.
<script type="text/javascript" src="emailTracking.js" ></script>
- Ensure to call the function that creates the tracking cookie.
<script language="javascript"> createTrackingCookie(); </script>
- Once the cookie has been created, all subsequent pages will be auto tracked by the cookie and reported back, without requiring the cookie be regenerated. This assumes the browser session isn't ended.
3. Tracking website events
- To track website events the page must include the email tracking javascript file, even if it is not a destination page.
<script type="text/javascript" src="emailTracking.js" ></script>
-
Tracking an event is as simple as adding an onClick attribute to a button and calling the function trackPage. function creates an image in the DOM (Document Object Model) that isn't affixed to a parent. The act of setting a SRC attribute for this causes a GET request on the Pure Response tracking end point.
<input type="button" value="Buy!" onclick="javascript: trackPage('sale', '19.99');" /> <input type="button" value="Signup!" onclick="javascript: trackPage('registration', 'joe.bloggs');" />
Alternative Setup : Non JavaScript
(i.e. on a page load)
1. Email Message
- First create a special tracked link in the email message:
<a href="http://www.foo.com/salespage.html?_pureTrackingName=FOOSALES"> SHOPPING PAGE </a>
The URL parameter (_pureTrackingName) will be obscured in the users browser address bar. Essentially this is a trigger that tells the platform to create a cookie when a recipient clicks through the link in the email. You should choose an appropriate name to use that will identify you and your tracked process. This prevents problems with recipients that receive multiple tracked emails from Response and clickthe links within the same browser session. Consider concatenating your profile name with the process (i.e. profile is FOO, process is SALES or QUOTES etc.)
2. Website
Ensure that your web server (URL REWRITE) is configured to allow incoming URL parameters, you can test this by navigating to your site with a test parameter.
"http://www.yoursite.com/home.html?a=1"
If the page accepts URL parameters the "?a=1" will remain in the address bar.
3. Use an Img Tag to force a GET request on Page Load
-
A HTML tag can be used that makes a direct GET request to a given location with URL parameters, for instance using the IMG tag. This can generate the event in the report.
<img src="http://response.pure360.com/_act/tracking.php?_pureTrackingName=FOOSALES&type=SALE&desc=49.99" />
WARNING: If the profile within Pure Response is using web masking then the URL in the image SRC attribute above must replace the response.pure360.com domain with the custom web domain. -
The above link would perform a GET request to the tracking endpoint, accessing the process called "FOOSALES", with the "TYPE" as "SALE" and the value as "49.99". The Response platform will lookup the recipients mailId in the cookie generated in the browser session clicking the link in the email, and tie the request back to the recipient and the campaign report.
WARNING: It's essential that the _pureTrackingName parameter value matches the _pureTrackingName value given to the link in the email generated in stage 1 of this process