How can we help you?
Although the revenue tracking snippets have been updated in the platform, the legacy revenue tracking snippets as seen in this article still work, and they are also compatible with the updated snippets. Please refer to the following Help article for more information on the updated revenue tracking snippets: Revenue & Conversion Tracking - How to View the Tracking Pixel Code Snippet.
Setting up the legacy revenue tracking involves placing a small snippet of JavaScript code in the footer of all pages of your web site. Additionally, a hidden data field is also included on the conversion thank-you page. These elements track the source of a click from the publisher through conversion.
Here’s how to find the snippets:
The first snippet of code needs to be placed on all landing pages in your web site. This code captures the source of the click (specifically, the keyword ID). It should be placed in the footer, just before the </html> tag. Here's the code:
<!-- begin Marin Software Tracking Script -->
<script type='text/javascript'>
var _marinClientId = "7gsv027b70";
var _marinProto = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Cscript src='" + _marinProto + "tracker.marinsm.com/tracker/" +
_marinClientId + ".js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type='text/javascript'>
try {
_marinTrack.trackPage();
} catch(err) {}
</script>
<noscript>
<img src="https://tracker.marinsm.com/tp?act=1...7b70&script=no" >
</noscript>
<!-- end Copyright Marin Software -->
This section of the code sets the protocol of page (http or https) and loads the relevant JavaScript:
var _marinClientId = '7gsv027b70'; [ client ID ]
var _marinProto = (("https:" == document.location.protocol) ? "https://" : "http://");
This code examines the page and sets the appropriate cookies:
try {
_marinTrack.trackPage();
This noscript tag is used to catch browsers that do not support JavaScript:
<noscript>
<img src="https://tracker.marinsm.com/tp?act=1...7b70&script=no" >
</noscript>
The second snippet is similar to the landing page code but is preceded by information about the purchase. This form + code content needs to be placed on the confirmation or thank you page that is displayed after a customer has converted on your website. This code sends the details associated with the conversion.
It is preceded by a hidden form which contains the purchase information:
<form style='display:none;' name='utmform'>
<textarea id='utmtrans'>
UTM:T|<order-id>|<affiliation>|<total>|<tax>|<shipping>|<city>|<state>|<country>
UTM:I|<order-id>|Purchase|<ProductName>|<category>|<price>|<qty></textarea>
</form>
The conversion type for this confirmation snippet would be inserted after the second pipe in the UTM:I line (in the above example, this would be for the "Purchase" conversion type). Please note that the UTM:T and UTM:I values within the angle brackets < > would be dynamically populated values, which should be inserted server-side directly into the pixel.
And here is the code snippet:
<!-- begin Marin Software Tracking Script -->
<script type='text/javascript'>
var _marinClientId = "6w1k7qwbc0";
var _marinProto = (("https:" == document.location.protocol) ? "https://" : "http://");
document.write(unescape("%3Cscript src='" + _marinProto + "tracker.marinsm.com/tracker/" +
_marinClientId + ".js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type='text/javascript'>
try {
_marinTrack.processOrders();
} catch(err) {}
</script>
<noscript>
<img src="https://tracker.marinsm.com/tp?act=2...ate|country%0A" />
</noscript>
<!-- end Copyright Marin Software -->
The optional UTM:T line in the hidden form provides information about the order total. The optional UTM:I lineprovides information about individual items in the order. If included, it should be repeated once for each line item in the order. Within each line, all of the additional variables are optional, however, in order to correctly parse the results, all of the | (pipe) delimiters must be included.
As an example, for tracking the order total only, the code should read:
<form style="display:none;" name="utmform">
<textarea id="utmtrans">
UTM:T|||XX.XX|||||
</textarea>
</form>
For conversion tracking only, the code should read:
<form style="display:none;" name="utmform">
<textarea id="utmtrans">
UTM:T||||||||
</textarea>
</form>
Note: If using multiple currencies, add the following code and replace the value of the currency parameter with the appropriate ISO currency code. (For example, if orders are placed in Pounds or Dollars, for each transaction pass the appropriate currency value – currency : ‘GBP’ OR currency : ‘USD’).
<script type='text/javascript'>
var _marinClientId = '6w1k7qwbc0';
var _marinTransaction = {
currency : ‘USD’
};
var _marinProto = (("https:" == document.location.protocol) ? "https://" : "http://");
The revenue tracker can be tested using the link at the bottom of this page. Once revenue tracking has been set up, this utility will show the last hour or last 24 hours (capped at 1,000 rows) of tracker data.
There may be times that you see no conversions in the platform, even though conversion tracking is set up. There are a number of different issues that can cause this, but in the first instance you should check that your tracking code snippet is implemented properly. Here’s how to do that:
Important note about the 'Thank you' snippet
You cannot have an HTML <form> (ie. the tracker 'Thank You' page snippet form) within another HTML <form>. If this is the case, it will cause the script to break and not capture conversions. A workaround for this is to just use the tracker image pixel. In this case, the tracker script on your 'Thank You' page would look similar to the following:
<!-- begin Marin Software Tracking Script -->
<img width="1" height="1" src="https://tracker.marinsm.com/tp?act=2&cid=<tracker-id>¤cy=<currency-iso-code>&trans=UTM:T|<order-id>|<name>|<total>|<address>|<city>|<state>||%0AUTM:I|<order-id>|<conversion-type-id>|<sku>|<category>|<price>|<qty>" />
<!-- end Copyright Marin Software -->