How do NextTag, JellyFish, Google Adwords & Overture track orders?
NextTag.com is a service that aggregates product info from different vendors and offers comparison shopping. Essentially, vendors have to work to ensure that they offer the lowest prices for a product so that when a consumer compares prices among the same product types, their products get clicked.
When a consumer clicks on a product, they're taken to the vendors site and if they buy a product, NextTag gets a cut. In order to determine whether they came from a NextTag, a vendor needs to include the following snippet into the final page of the order process:
/* NexTag ROI Optimizer Data */
var id = '1234567'; // Merchant ID var rev = '12.99'; // Total amt of the purchase
</script>
<script type="text/javascript" src="https://imgsrv.nextag.com/imagefiles/includes/roitrack.js"></script>
This snippet somehow allows NextTag to differentiate between normal orders and order explicitly referred by NextTag. For example, if you receive 10 orders today and 3 were referred by NextTag, the code snippet somehow knows this.
I want to do something like this but can't for the life of me figure out how they did it. I checked my cookies and there are no NextTag cookies set at all (sub-domain either). JellyFish.com, Google Adwords, & Overture all do something similar.
JellyFish:
<script type='text/javascript'>
var jf_merchant_id = 'YOUR_CUSTOM_MERCHANT_ID';
var jf_merchant_order_num = 'ORDER_NUMBER';
var jf_purchased_items = new Array();
// adding cart items FOR EACH PURCHASED ITEM...
// add cart item var jf_item = new Object();
jf_item.mpi = 'ITEM_PRODUCT_ID';
jf_item.price = 'ITEM_PRICE';
jf_item.quantity = ITEM_QUANTITY;
jf_purchased_items.push(jf_item);
NEXT PURCHASED ITEM
</script>
<script type='text/javascript'
src='https://www.jellyfish.com/javascripts/1x1tracking.js'>
</script>
<!-- End Jellyfish Tracking Pixel Code -->
Can anyone shed some insight on how this is done?





there are actually a bunch of cookie that nexttag sets inside your browser one them being your visitorid. Basically what they do is use the roitrack.js to build a url with this information to hit the roitrack.jsp (if you open the roitrack.js you'll see it being built). Once the request is made they read the cookie information on your machine and match it up.
Obviously they have to have a little faith in their merchants to pass them the correct revenue amount and order id. There are clauses in the contracts that you sign that permit them to audit you if they get suspicious that you aren't passing the correct information.
I done this type of system in the pass and at fist it was a little head kicker, but after you look at it for a while, you can figure it out.
If you're thinking about writing a system like this and need help, give me a call.
Send me your # via email and I'll call you.
Thanks for the suggestion, though. :)
PS: Good chatting w/ u via IRC at jQueryCamp
but how does it tracks for orders done through google checkout?
Please someone can explain this?