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:

<script type="text/javascript">
/* 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:

<!-- Begin Jellyfish Tracking Pixel Code -->
<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?

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
tony petruzzi's Gravatar Rey this is how it's 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.
# Posted By tony petruzzi | 10/19/07 6:31 PM
Rachel Maxim's Gravatar I'm sort of guessing here, but couldn't the script that you're linking to get the values from the embedded JavaScript and send it to some type of service that tracks the order?
# Posted By Rachel Maxim | 10/19/07 6:32 PM
Rey Bango's Gravatar @Tony: The cookie solution is what I initially thought as well but I can't find any NextTag cookies. Did you find them by chance? If cookies are set, then any requests made to NextTag would automatically send the cookies for that domain.

Send me your # via email and I'll call you.
# Posted By Rey Bango | 10/19/07 6:55 PM
Rey Bango's Gravatar @Rachel: The thing is that since the order needs to be finalized on the merchant's site, NextTag needs some mechanism that they can access in order to know that an order actually occurred. Cookies are usually the solution for that but I can't find any cookies for NextTag. In terms of JS, they can't reference that because of same domain policies built-into the browsers for security.

Thanks for the suggestion, though. :)
# Posted By Rey Bango | 10/19/07 6:58 PM
Dossy Shiobara's Gravatar Why do cookies need to be involved at all, here? They don't track details down to the end user's activity--only by merchant by product.
# Posted By Dossy Shiobara | 10/28/07 8:43 AM
Rey Bango's Gravatar @Dossy: Cookies are discussed because they're sent over via every http request for a specific domain and vendors have traditionally used them to easily track visitors in this type of scenario. In the case of NextTag, it's not obvious to me how they're tracking when a sale comes from a referral from their site.

PS: Good chatting w/ u via IRC at jQueryCamp
# Posted By Rey Bango | 10/28/07 9:21 AM
Ganesh's Gravatar Since Jelly Fish is an VPA model, it can track order placed on merchant webiste by placing the track code on order confirmation page,
but how does it tracks for orders done through google checkout?
Please someone can explain this?
# Posted By Ganesh | 4/15/08 9:25 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.