Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Track number of users click on link to check prices

Looking for a way to track users

2:58 pm on May 8, 2008 (gmt 0)

5+ Year Member


We have a website which sell products.

To display the prices the user clicks a 'Buy Now' button and is referred to a third party server, this third party server holds all prices and also captures credit card details etc should the user want to proceed. All we do is pass a product reference number to the third paty server and that server then displays product costs shipping costs etc.

Is there a way to record when a user clicks the 'Buy Now' button.

We want a way to anaylse the number of users who look at prices on third party server and do or do not buy a product?

Site is in HTML on 2003 Server with IIS.

Thanks in advance.



4:03 pm on May 8, 2008 (gmt 0)

5+ Year Member

You could capture many of user clicks via AJAX (Javascript) and have it request a special page you would setup. Thus you could see how many times that page was hit if you have some IIS log traffic anaysis tool.

This is all assuming you have no server side scripting language or DB (didn't see it mentioned so I assumed there wasn't). If you do, there are much more elegant ways to accomplish this.

4:12 pm on May 8, 2008 (gmt 0)

5+ Year Member


Thanks for the response.

How would I go about using javascript to request a page?

Is it somehow connected with the button?

Please advise?



2:33 am on May 13, 2008 (gmt 0)

5+ Year Member

I can give you the javascript but I would suggest a JS framework such as jQuery. You can include the file across the board or just on the page you want to measure. The frameworks make everything with JS much much much easier (it's really that good).

You can do what we are talking about in one line with jQuery:


9:46 am on May 13, 2008 (gmt 0)

5+ Year Member


Thanks for the response.

I will have to do some research on a jQuery, never come across it.

In the time between my original post, I have tried different approaches including using the onclick event on the buy now button to html page so it logs a record in the weblogs that I can track, but it also opens the html page which is not good.

I will look into jQuery.



12:36 pm on May 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Hi q582gmzhi,

Does your server have .asp capabilities? I have a click-through tracking script I use to track clicks on one of my web sites. It logs the date, time, user IP, target and referrer then forwards them to the requested link. However, I am not sure if it will work with a form, but you can give it a try if you want.


2:10 pm on May 13, 2008 (gmt 0)

5+ Year Member

Here is the code for jQuery:

Download the js file and put it on your server then include it in the head of the html on whatever pages you want to track.

<script src="/js/jquery.js" type="text/javascript"></script>

Then create a small JS code section in the head like the following:

<script type="text/javascript">
//load the code once its ready
//find the id property of the link (make sure its unique) and when it is clicked do whats in this function
$('#linkidgoeshere').click(function ()
//make an ajax call to the page you setup

I can send you example files, send me a sticky if you wish.

2:24 pm on May 13, 2008 (gmt 0)

5+ Year Member

Thanks Venti,

I will try doing it on my own using your instructions, if I fail to get it working I will drop you a PM for the sample files.



9:23 pm on May 14, 2008 (gmt 0)

10+ Year Member

I have a very simple solution for you. It's called Google Analytics. It is simple, easy to use and by adding a little bit of outbound link tracking code to each link you can track all your outbound links.

Just google it. We also have message board dedicated to software like this.


Featured Threads

Hot Threads This Week

Hot Threads This Month