HitsLink – Prevent Duplicate Leads & Conversions From Being Reported


I’m a big fan of HitsLink – a third-party hosted client-side web stats service. Its similar to WebTrends, ClickTracks, Urchin, and all the others – although generally I’d classify it as a more basic offering. For many sites that makes it preferred – as its very quick to setup, is fairly flexible, and gives lots of great data. The new WebTrends 7.5 (or whatever version they are up to now) and other well-known web traffic analysis packages often can go a good bit deeper than HitsLink, but in my opinion the increased price and setup time they come with often does not justify it. I generally find that HitsLink has plenty of data for me – I barely have time to act on it… Lord knows what I would do with more data!

(Main Part of Post)

Anyhow, one issue I’ve had on many sites for a while now is that I had been getting duplicate conversions recorded in HitsLink for the same lead. Essentially it was when someone would fill out a form and maybe accidentially or (due to impatience) click “submit” twice. Or perhaps they’d fill out the form and submit, and then realize they wanted to add or correct something, so they’d hit the back button and submit the form again with a slight modification. One additional cause could be if you are using a “confirmation” page to call the conversion script, and the user decides to stick on the site for a while, maybe either refresh the confirmation page or navigate away, then hit the back button a number of times to find a previous page – during which time they would pass the confirmation page again, causing the script to be called and thus record another duplicate.

For most e-commerce sites you can plug in a unique order ID in the HitsLink conversion script:

… where you would just replace “YOUR-UNIQUE-ID” with a dynamic value generated by your e-commerce system – perhaps a sales order number or something like that. Each number is unique to that one transaction, and thus even if the script/image call was activated several times it would only count 1 conversion for each unique ID.

That’s great for e-commerce sites, but most of my clients are service businesses. They are lead generation sites. The conversion is a lead form that is not connected to any e-commerce engine, so I had no unique ID number available. Then I found a rather obvious solution. Use what you do have. Most contact forms ask for a Name, Email Address, perhaps a Phone Number, etc. Use one of those fields and pass that through. Thus, if person@email.com submitted the form and was therefore one lead, but activated the script 3 times (see above possible reasons for this), than if you used their email address – person@email.com as the unique ID it would only register the first conversion and not skew your stats. If you think about it, for most sites an email address will be unique for our purposes, unless of course your site aims to get repeat leads from the same person over time – in which case you should completely ignore this article ๐Ÿ™‚

I was elated to discover this method. I had wanted to rely on HitsLink to count leads for my sites, but I often found duplicates skewed the numbers so I’d have to manually count leads or rely on another data source.

There’s also another great benefit. Using either the email address or name or phone number makes it easier to match up the leads in your “Latest Transactions” report with what comes through either to your database or email if your contact form sends to one of those. In the past I tried to match up leads and see where each specific one (on a micro level) came from, what they searched on if they came from a search engine, etc. I had to use the time field to do this. I’d see what time the lead came in via email, and then match that up with HitsLink’s recorded time. Sometimes due to time zones or whatever else the two times might be 1-3 hours off (daylight savings, time zones, etc.) and/or also several minutes off. Thus Lead A might show 10:35 am in my email and 11:29 am in HitsLink. That’s a pain. Matching email addresses or actual names is much easier, and allows you to dig deeper to see where the “good” leads came from rather than just relying on drawing assumptions based on the macro-data.

Okay, So How?

Most forms post to some script or other page – maybe a Pearl page, ASP page, PHP page, etc. to process the form. Then, its common practice to redirect the user to a confirmation page. The processing page runs so quickly and is not displayed that to the user it just looks like they click submit and are taken to a confirmation page.

This is the method I used, and thus what I’ll describe. You can do it other ways too. Steps for this method:

1) Pick your unique ID field and make sure its going to be unique for each lead – a Name (usually unique, although you might have issues with real common names and high traffic sites), an email address (generally pretty unique), etc.

2) On your form processing page you’ll need to add a call for this value into the URL of the confirmation page. Thus, instead of redirecting to www.website.com/confirmation.php you’ll need to redirect to www.website.com/confirmation.php?unique=person@email.com where “unique” can be any parameter name you want and “person@email.com” must be a dynamic value – a call for the name of the field. In ASP you might try plugging in


into your URL. Something like this would work:

response.redirect (“http://www.website.com/confirmation.asp?unique=”&request.QueryString(“name_of_form_field_youre_using”))

Be aware that you may need to play with the syntax as your dynamic call might have apostrophes and parenthesis that cause issues. Talk to someone who knows the programming language and they should be able to give you a work around for the syntax. Once implemented, this will redirect the person to the confirmation page upon form submission, and in the URL it will pass your unique value.

3) The next step is to grab that unique value from the URL and plug it into HitsLinks confirmation image call – which is basically what records the event in HitsLink. Thus you’ll modify that script:

by plugging in the value you passed in the URL into the YOUR-UNIQUE-ID area (replace it). In our example that would look like this:


if you were to use ASP – where < %=Request.QueryString("unique")%> is the ASP call to grab the “unique” value from the URL string. That will render first server-side, such that when the HTML is loaded into the browser it will replace < %=Request.QueryString("unique")%> with person@email.com or whatever you chose, and record that into HitsLink.

Now you’ve just eliminated the chance for having your HitsLink skewed with duplicate leads from person@email.com, and you’ve also made it easier to match up the lead that was delivered to you with their campaign, search engine, search phrase, or whatever other data you want in the “Latest Transactions” report in HitsLink.

Wow that took a long time to write! I hope this helps someone or several someones!

My Other Posts About HitsLink:

By the way, I just did a Google search on hitslink and saw that their URL displayed is showing a source=Alexa parameter. In practice, that would make it look as though every visitor that actually came to their site from Google with that search (their name) was recorded as being from the “Alexa” campaign.

As a general rule of thumb I advise ONLY using source= or other campaign tracking codes on links that won’t be indexed – such as when imbedded in a script via a banner ad or on a pay-per-click ad. Those URLs aren’t indexed, and thus won’t skew your stats. HitsLink is great at making a good product, though not so sure they are great at using their own product!!! ๐Ÿ™‚