Campaign Tracking Implementation Guide

Glossary of Terms

Our product provides powerful campaign conversion tracking to your website.  The two primary features are:

  • The ability to track referrals from marketing campaigns, such as pay-per-click search engines, email promotions, etc.
  • The ability to track orders and other transactions from the referrals to see if your marketing programs are effective.

    The ability to track from referral source straight through to transaction detail can be implemented in three easy steps:

    1.  Determine What You Wish to Track

    You can track user-defined transactions such as orders, trial versions, refunds, opt-ins, etc.  The first step is to determine which transaction types you wish to track and set them up.  The transactions are called User-Defined Transactions (UDTs) in the system.  To perform this step, go to the Campaigns / Setup / Define Transaction Types menu item.

    If you only want to track referrals and do not wish to track transactions, you may skip this step.

    Once you set up your transaction types, they will appear in the 'Campaign / Activity Summary' report and each UDT will appear as a filter for reporting.

    2.  Setup Campaign Identifiers

    Your referring site should pass the reference site campaign identifier.  For example, in the case of pay-per-click or email marketing campaigns, you may choose to track order detail, back to click-through analysis from these campaigns.  This can be used to verify your monthly statements from your referral network as well as to analyze which marketing programs are giving you the best return on your investment. 

    To enable a referral source for tracking simply include an additional parameter (named "source") on your referral link from the referring site (e.g.  Overture) as follows:

    http://www.mywebsite.com?source=overture

    where [http://www.mywebsite.com] is the url you are driving traffic to and "overture" is the referral site campaign identifier that will be tracked.  The campaign "overture" will now be tracked and reported.

    Alternatively, this same capability can be used to track referrals from email marketing campaigns or other emarketing programs as follows:

    http://www.mywebsite.com/source?source=email_campaign3

    where [http://www.mywebsite.com] is the click-through link in your outbound campaign.  The referrals from this campaign will be reported under the campaign "email_campaign3".

    Campaign identifiers do not need to be setup in your account before adding them to your referral links.  They will be automatically back-written when a click-through occurs.

    3.  Cut and Paste Tracking Script(s)

    There are 2 types of tracking scripts to add to your site:

  • The traffic tracking script, which tracks traffic and referring data.  This script should be placed on every page you want statistics on.
  • The conversion tracking script(s), which track orders and UDTs.  This script should be placed on your UDT confirmation page(s).

    You can get these scripts from the Account / Setup / Get Tracking Script menu item.

    The scripts must be cut and pasted into pages that are to be tracked.  If your site uses a common "header" of "footer" you may update your existing script that is referred to for tracking included in the common header or footer.  If you do not use a common header or footer you must include the tracking script on each page you choose to track.

    For the conversion tracking script(s), you can optionally modify two parameters for revenue and a unique identifier, such as an order number.

    The order tracking script is an image tag that looks like this:

    <IMG src="https://counter.hitslink.com/confirmation.asp?
              acct=sample&type=0&s=22&uniqueId=YOUR-UNIQUE-ID&orderAmount=YOUR-ORDER-AMOUNT">

    This is an example script only, please do not use it on your website.

    Notice the 'YOUR-UNIQUE-ID' parameter.  This can optionally be modified to contain an order id or other unique identifier that will be tracked with the transaction.  The added benefit of this is that it eliminates duplicates from being tracked, since the system will not record transactions with duplicate unique ids.  Only put alpha-numeric characters in this parameter with no spaces.

    The 'YOUR-ORDER-AMOUNT' parameter is the total order amount.  Do not put a $ in front of the amount.

    These parameters will generally need to be modified with server-side script, depending on the server technology your site employs.

    Notes on the YOUR-UNIQUE-ID Parameter on the Tracking Scripts:

  • If you don't fill it in, duplicate transactions can occur.
  • If you execute a script with the same unique id as a prior transaction, but a different amount, the changed amount will be recorded and a change transaction will be displayed in the transaction detail report.
  • If you execute a script with the same unique id as a prior transaction, but a different transaction type, the first transaction will be converted to the new transaction type.  If the amount also changed, the change will also be recorded.  The change transaction will be displayed in the transaction detail report.

    Setting up Common Scenarios

    Scenario 1 - Tracking Pay-Per-Click Search Engine Referrals:
  • Place the tracking script on all pages visitors may enter your site on.
  • Log into your pay-per-click account.
  • Modify the URLs to include the campaign identifier.

    For example:  http://www.mywebsite.com?source=overture

    Once this is done, all paid referrals from search engines will be automatically tracked under the 'overture' campaign name and will be viewable from the 'Campaigns/Activity Summary' report.  You may use multiple campaign names for more detailed tracking.

    Scenario 2 - Tracking E-Mail Promotions:
  • Place the tracking script on all pages visitors may enter your site on.
  • Include the campaign identifier in all links in the email that refer to your site.

    For example:  http://www.mywebsite.com?source=email

    Once this is done, all referrals from the email will be automatically tracked under the 'email' campaign name and will be viewable from the 'Campaigns/Activity Summary' report.

    Scenario 3 - Simple Order Tracking:
  • Create a User-Defined Transaction named "Orders" (if it does not already exist).
  • Paste the traffic tracking script on all your pages you wish to track traffic on.
  • Paste the "Orders" confirmation script on your order confirmation page.  Make sure to fill in the unique id and order amount parameters on the script.
  • If you wish to track campaign information, set up your referring links to include the campaign name parameter.

    Scenario 4 - Trial Versions That Convert to Orders:
    You wish to track data on trial versions.  After the trial version, a subset of customers purchase the product.  The trial transaction in this case converts to an order.

  • Create a User-Defined Transaction named "Trials".
  • Create a User-Defined Transaction named "Orders".
  • Paste the traffic tracking script on all your pages you wish to track traffic on.
  • Paste the "Trials" tracking script on your trial version confirmation page.  Make sure to fill in the unique id on the script.
  • Paste the "Orders" tracking script on your order confirmation page.  The unique id should match the trial version's unique id.  This will ensure that the proper trial version transaction is converted to an order.
  • If you wish to track campaign information, set up your referring links to include the campaign name parameter.

    Scenario 5 - Orders with Refunds:
    In this scenario, you track orders, but also track refunds.  The refunds are tracked separately from orders and do not convert the order to a refund (unlike trials and orders above).

  • Create a User-Defined Transaction named "Orders".
  • Create a User-Defined Transaction named "Refunds".
  • Paste the traffic tracking script on all your pages you wish to track traffic on.
  • Paste the "Orders" tracking script on your order confirmation page.  Make sure to fill in the unique id on the script.
  • Paste the "Refunds" tracking script on your refunds confirmation page.  Make sure the unique id is different than the order's unique id.  This will ensure that the refund is tracked separately.  Optionally, make the refund amount a negative number so the revenue totals are accurate.
  • If you wish to track campaign information, set up your referring links to include the campaign name parameter.

    Code Samples:
    The only code you will need is for the order id and order amount.  It is not required that these be filled in, but the the reporting is more robust if you do.

    Code Sample for Active Server Pages (ASP):

    Assume that your order page has a HTML form on it that contains your order id and order amount.  For example:

    Code for your order page (EXAMPLE ONLY):

    <FORM method=post action=confirmation.asp>
    <input type=hidden name="orderid" value="ORD1000">
    <input type=hidden name="orderamt" value="99.95">
    </FORM>


    Then, on your confirmation page, you would use the following example code to fill in the order id and order amount:

    Code for your confirmation page (EXAMPLE ONLY):

    <IMG src="https://counter.hitslink.com/confirmation.asp?acct=YOURACCT
         &uniqueId="<%= Request.Form("orderid") %>"
         &orderAmount="<%= Request.Form("orderamt") %>">


    Code Sample for PHP:

    Assume that your order page has a HTML form on it that contains your order id and order amount.  For example:

    Code for your order page (EXAMPLE ONLY):

    <FORM method=post action=confirmation.asp>
    <input type=hidden name="orderid" value="ORD1000">
    <input type=hidden name="orderamt" value="99.95">
    </FORM>


    Then, on your confirmation page, you would use the following example code to fill in the order id and order amount:

    Code for your confirmation page (EXAMPLE ONLY):

    <IMG src="https://counter.hitslink.com/confirmation.asp?acct=YOURACCT
         &uniqueId="<?php echo $HTTP_POST_VARS['orderid'];?>"
         &orderAmount="<?php echo $HTTP_POST_VARS['orderamt'];?>">


    Code Sample for Perl:

    Assume that your order page has a HTML form on it that contains your order id and order amount.  For example:

    Code for your order page (EXAMPLE ONLY):

    <FORM method=post action=confirmation.asp>
    <input type=hidden name="orderid" value="ORD1000">
    <input type=hidden name="orderamt" value="99.95">
    </FORM>


    Then, on your confirmation page, you would use the following example code to fill in the order id and order amount:

    Code for your confirmation page (EXAMPLE ONLY):

    print "<IMG src=""https://counter.hitslink.com/confirmation.asp?acct=YOURACCT";
    print "&orderid=$FORM{'orderid'}";
    print "&orderAmount=$FORM{'orderamt'}">;


    Code Sample for Javascript:

    The method is to output the order confirmation IMG tag using javascript.  The code to output the tag also plugs in the variables for the transaction.

    Assume that you have the order id and order amount contained in javascript variables.

    Code for your confirmation page (EXAMPLE ONLY):

    <SCRIPT language="javascript">

    var orderId = 10000; // put the order id in this variable
    var orderAmt = 99.95; // put the order amount in this variable

    document.write('<IMG src="https://counter.hitslink.com/' +
    'confirmation.asp?acct=YOURACCT' +
    '&orderid=' + orderId +
    '&orderAmount=' + orderAmt +
    ' height=1 width=1 border=0>"');

    </SCRIPT>