How can we help you?
Introduction |
This guide documents the steps necessary to integrate conversions and revenue using Marin Tracker JavaScript. Marin will work with the customer during scoping and configuration process to document the specifics regarding:
About the Tracker JavaScript CodeMarin's Asynchronous JavaScript click and conversion capture code snippets record incoming traffic and conversions from paid search. This code can also be used to show conversion relationships (called "paths") between paid search and other media channels such as affiliate marketing, online display campaigns and natural search. The asynchronous nature of the code means the pixel is built in the background, and will not affect page load speed.
|
What does this code do: The javascript will log the keyword and creative that brought the visitor to your site, based on, but not limited to, the keyword ID and creative ID which are embedded in the paid click destination URL. The Javascript will capture the referring URL, Destination URL, and set a Cookie ID (UUID) in the user’s browser then send all three values to Marin. This Click data will be joined with Conversion data in order to attribute conversions to a keyword or creative. In the unlikely event that JavaScript is disabled in the browser the <noscript> image pixel will fire, but will not contain any tracking data, it is used for auditing purposes only. Where to place the code: The following javascript code snippet is to be exposed on all landing pages of the website, ideally by being placed in a global template such as a footer template.
Please note the code in this section is only an example and should not be placed on the customer's landing pages.
|
Marin will work with the customer during scoping and Integration Plan development to define their conversion types in the following table:
Conversion Type |
Conversion ID |
Conversion Source |
Use for Bidding? |
Many or 1 Per Click? |
Attribution Date |
Example: Sale |
Sale |
Marin Tracker |
yes |
many |
Click/Conv Date |
Example: Lead |
Lead |
Marin Tracker |
no |
many |
Click/Conv Date |
Where:
Marin Software cannot effectively bid against user engagement metrics like pageviews, bounces, time on site, and other non-transactional conversion information. During the Integration Plan review call customer will to confirm conversion types, # Conversions per Click, and Method of Attribution (Date of Click versus Date of Conversion or both.
What does this code do: The Javascript will take the values specified below in the array of conversion metrics and send them to Marin along with the Cookie ID (UUID) created by the Click JavaScript; this allows Marin to join Clicks and Conversion data together. The client’s development team is responsible for inserting the appropriate conversion data into the fields specified below, using server-side logic. The fields below are defined in a JSON Array as a name-value pair; field values are defined below the code snippet. In the unlikely event that JavaScript is disabled in the browser the <noscript> image pixel will fire, but will not contain any tracking data, it is used for auditing purposes only.
Where to place the code: The following javascript code snippet should be placed on the Conversion Success Page (thank you page). If using an On-Click Event to track Conversion events please consult with your Marin onboarding team first.
Please note the code in this section is only an example and should not be placed on the customer's conversion pages.
<!-- BEGIN: Marin Software Tracking Script -->
<script type="text/javascript">
var _mTrack = _mTrack || [];
_mTrack.push(['addTrans', {
currency :'<ISO-CURRENCY-CODE>',
items : [
{
orderId : '<ORDER-ID>',
convType : '<CONV-TYPE-ID>',
product : '<PRODUCT-SKU/NAME>',
price : '<PRICE>',
category : '<CATEGORY>',
quantity : '<QUANTITY>'
}
]
}]);
_mTrack.push(['processOrders']);
(function() {
var mClientId = '[CLIENT-TRACKING-ID]';
var mProto = ('https:' == document.location.protocol ? 'https://' : 'http://');
var mHost = 'tracker.marinsm.com';
var mt = document.createElement('script'); mt.type = 'text/javascript'; mt.async = true; mt.src = mProto + mHost + '/tracker/async/' + mClientId + '.js';
var fscr = document.getElementsByTagName('script')[0]; fscr.parentNode.insertBefore(mt, fscr);
})();
</script>
<noscript> <img src="https://tracker.marinsm.com/tp?act=2&cid=[CLIENT-TRACKING-ID]&script=no" > </noscript>
<!-- END: Copyright Marin Software --> |
Field Name |
Definition |
Source |
Required |
[CLIENT-TRACKING-ID] |
Static Alphanumeric value, unique to each Marin Client Account, provided by your PS Onboarding Team |
Marin |
Required |
<ISO-CURRENCY-CODE> |
The ISO Currency Code is a 3 digital value that presents the currency for a specific country. Insert ISO code if currency for this transaction is different from the Client Accounts default currency type, else remove the placeholder and leave blank. |
Client |
Optional |
<ORDER-ID> |
The conversion event’s unique identifier which can be used in reporting as well as de-duping, in case of a page reload. It is very important the Order-ID is not recycled at any time as the ID will be used for de-duplication. If an order-ID is not available please remove the placeholder and leave blank. This value should be the same in all instances where you are replacing the <ORDER-ID> placeholder. |
Client |
Optional |
<CONV-TYPE-ID> |
The conversion type ID is defined in the Conversion Types Section of the Integration Plan, and corresponds to the Conversion Event. |
Marin |
Required |
<PRODUCT-SKU/NAME> |
This field can be used to pass Marin information about the product or transaction, else remove the placeholder and leave blank. |
Client |
Optional |
<CATEGORY> |
This field can be used to pass Marin information about the product category or other transaction information, else remove the placeholder and leave blank. Note: This value can only be accessed from Custom Reports in Marin. |
Client |
Optional |
<PRICE>* |
Price per Item/transaction. Marin will multiply <PRICE> X <QUANTITY> to get the TOTAL value, in the App. If no revenue, remove placeholder and leave blank. Example: 30.20 (Decimal value only, do not include symbols) |
Client |
Optional |
<QUANTITY> |
The number of items purchased in this transaction. |
Client |
Optional |
*<Price> X <Quantity> clarification: When a user converts via a single action which triggers Marin Tracker, the pixel picks up granular data per item's quantity. So if a user buys 3 pairs of shoes for 50 each, a pair of gloves for 20 and 2 shirts for 10, the Javascript pixel will parse those out as "50|20|10" for price, and "3|1|2" for quantity. Each of those will be mapped to each other and multiplied to get the total revenue, which will be "190" (50x3 + 30x1 + 20x2)
In order for Marin to track using Tracker to attribute conversions/revenue, each keyword, creative, and placement URL must be tagged with a unique identifier (ID). We are recommending the following URL structure where the highlights represent the required Marin variables:
The following table illustrates the values which will be substituted using when using Marin variable insertion.
Insertion Variable |
Function |
Google |
Microsoft |
FaceBook |
[uniq_id] |
Inserts an 8 character unique alpha-numeric ID |
8 character unique ID |
8 character unique ID |
8 character unique ID |
[distribution] |
Inserts the dynamic publisher parameter for click source |
{ifsearch:s}{ifcontent:c} |
|
|
[device] |
Inserts a single digit character for device type: [c, m ,t] if available. |
{device} |
|
|
[creative_id] |
Inserts the dynamic insertion parameter for creative id |
{creative} |
{Adid} |
|
[keyword_text] |
Inserts the dynamic insertion parameter for keyword |
{keyword} |
{keyword} |
|
[matchtype] |
Inserts the dynamic insertion parameter for matchtype |
{Matchtype} |
{Matchtype} |
|
The following lead parameters should be included for the given publisher where an “X” is present. The {device} value will either be placed within the MKWID parameter or in the PDV parameter, not both.
Parameter Name |
Insertion Variable |
|
Microsoft |
|
mkwid |
[uniq_id] |
X |
X |
X |
mkwid |
[distribution] |
X |
X |
|
mkwid |
[device] |
X |
|
|
pcrid |
[creative_id] |
X |
X |
|
pkw |
[keyword_text] |
X |
X |
|
pmt |
[matchtype] |
X |
X |
|
pdv |
[device] |
X |
|
|
Creative URL Variables |
|
Same as Above |
{param1} |
Same as Above |
The following settings under keyword ID parsing will need to be configured in the Marin application:
Parameter |
Start after these sequences |
Stop after these Sequences |
Tracking ID |
mkwid |
& |
{Creative} Parameter |
pcrid |
& |
Keyword |
pkw |
& |
Matchtype |
pmt |
& |
Device Type Appended? |
Device Delimiter |
NO |
Pipe (“|”) OR Underscore (“_”) |
The following settings will be enabled for the client in the Marin URL Builder:
Publisher |
Populated Keyword Level URL |
|
mkwid=[distribution][uniq_id]&pcrid=[creative_id]&pkw=[keyword_text]&pmt=[matchtype]&pdv=[device] |
|
mkwid=[distribution][uniq_id]&pcrid=[creative_id]&pkw=[keyword_text]&pmt=[matchtype] |
|
mkwid=[uniq_id] |
Auto URL Correction Settings |
|
Auto URL Correction |
Warn (Professional Services will enable immediately following the initial URL tagging process if applicable). |
Auto Build URLs on Creative |
On |
Auto Build URLs on Placements |
On |
Marin supports two methods for tracking Google sitelink performance. Please note that only one option may be selected.
Marin can attribute revenue to the keyword that triggered the sitelink. This allows you to appropriately bid on keywords since you know the true ROI of the keyword. The disadvantage of this is that you do not know which sitelink triggered the conversion.
In order for conversion/revenue data from sitelinks to be properly attributed to the driving keyword, each Google Sitelink is appended with the following {copy} parameters:
|
If you wish to attribute conversions directly to the sitelink to track individual sitelink performance, then placeholder keywords are created in Marin for proper tracking. Even though this allows you to see what sitelink triggered the conversion, you do not know which keyword triggered the conversion. Additionally, this method makes keywords appear as though they are not driving as many conversions as Google attributes the click to the actual keyword, which may affect bidding.
Placeholder keywords are set up for each Google Sitelink and the URLs generated in Marin need to be copied over to the actual Sitelink in Google.
Step |
Task |
Owner |
Dependencies |
1 |
Review and finalize Integration Plan |
Client/Marin |
|
2 |
Setup URL Builder and Parser Settings |
Marin |
1 |
3 |
Deploy JavaScript click and conversion capture code |
Client |
1 |
4 |
Setup Conversion Types |
|
1 |
5 |
Build URLs, QA and traffic to publishers |
Marin/Client |
2 |
6 |
QA 3 days of conversion/revenue data |
Marin/Client |
3,4,5 |
7 |
Transition to Client Services Team |
Marin |
6 |
The Example below illustrates how multiple conversion types are captured. Because the Conversion Event is referencing more than one conversion type, it is important to ensure that the ORDER ID in unique per conversion type instance. Marin recommends the following setup options, in order of preference:
Option 1: Change the OrderID field to concatenate the conversion type ID to the Order ID. Ex: “[order-id]-[conv-type id]”
Option 2: If option 1 is not possible please leave the OrderID field BLANK
<!-- BEGIN: Marin Software Tracking Script -->
<script type="text/javascript">
var _mTrack = _mTrack || [];
_mTrack.push(['addTrans', {
currency : 'USD',
items : [
orderId : '123456-subscription', convType : 'subscription',
product : 'membership signup',
price : '20.00',
quantity : '1'
},
{
convType : 'upgrade_gold',
product : 'membership upgrade (gold)',
price : '10.00',
quantity : '1'
}
]
}]);
_mTrack.push(['processOrders']);
(function() {
var mClientId = '1a2b3c4d';
var mProto = ('https:' == document.location.protocol ? 'https://' : 'http://');
var mHost = 'tracker.marinsm.com';
var mt = document.createElement('script'); mt.type = 'text/javascript'; mt.async = true; mt.src = mProto + mHost + '/tracker/async/' + mClientId + '.js';
var fscr = document.getElementsByTagName('script')[0]; fscr.parentNode.insertBefore(mt, fscr);
})();
</script>
<noscript> <img src="https://tracker.marinsm.com/tp?act=2...3c4d&script=no" > </noscript> <!-- END: Copyright Marin Software --> |
The Example below illustrates how a single conversion type is captured.
<!-- BEGIN: Marin Software Tracking Script -->
<script type="text/javascript">
var _mTrack = _mTrack || [];
_mTrack.push(['addTrans', {
items : [{
orderId : '300188403',
convType : 'store_locator'
}]
}]);
_mTrack.push(['processOrders']);
(function() {
var mClientId = '1a2b3c4d';
var mProto = ('https:' == document.location.protocol ? 'https://' : 'http://');
var mHost = 'tracker.marinsm.com';
var mt = document.createElement('script'); mt.type = 'text/javascript'; mt.async = true; mt.src = mProto + mHost + '/tracker/async/' + mClientId + '.js';
var fscr = document.getElementsByTagName('script')[0]; fscr.parentNode.insertBefore(mt, fscr);
})();
</script>
<noscript> <img src="https://tracker.marinsm.com/tp?act=2...3c4d&script=no" > </noscript> <!-- END: Copyright Marin Software --> |
The Example below illustrates how a single conversion type is captured.
<!-- BEGIN: Marin Software Tracking Script -->
<script type="text/javascript">
var _mTrack = _mTrack || [];
_mTrack.push(['addTrans', {
currency : 'USD',
items : [
{
convType : 'sale',
product : 'mens running shoes',
price : '120.00',
quantity : '1'
},
{
convType : 'sale',
product : 'mens running socks',
price : '10.00',
quantity : '5'
}
]
}]);
_mTrack.push(['processOrders']);
(function() {
var mClientId = '1a2b3c4d';
var mProto = ('https:' == document.location.protocol ? 'https://' : 'http://');
var mHost = 'tracker.marinsm.com';
var mt = document.createElement('script'); mt.type = 'text/javascript'; mt.async = true; mt.src = mProto + mHost + '/tracker/async/' + mClientId + '.js';
var fscr = document.getElementsByTagName('script')[0]; fscr.parentNode.insertBefore(mt, fscr);
})();
</script>
<noscript> <img src="https://tracker.marinsm.com/tp?act=2...3c4d&script=no" > </noscript> |
<!-- END: Copyright Marin Software -->