0

I'm trying to log ad clicks on my website. When an ad is clicked there is always a GET request to a specific external website. I want my server to be notified as soon as this request is made. So this will allow me to count clicks.

A method that I'm considering but know nothing about is packet sniffers. Can anyone point me in the right direction to get my idea running.

That guy
  • 331
  • 1
  • 2
  • 11
  • You'd have to deploy a packet sniffer on the client computer, something that most people would not welcome. – Pointy Jul 26 '12 at 13:06
  • Why is it necessary to log GET requests? Why don't you just log clicks using JavaScript and send an Ajax request to your server and log that? This should be enough for you needs. – Christopher Tokar Jul 26 '12 at 13:09
  • Because I'm working with flash and I can't modify the file – That guy Jul 26 '12 at 13:39

3 Answers3

1

Google uses an Ajax format. When you click a link it looks like you're clicking a normal href, but what you are doing is sending an Ajax packet to Google and then moving to your desired page. You could do the same with JQuery.

Here's a link Click Logging with JavaScript

You can't put a packet sniffer on all your users' computers.

Community
  • 1
  • 1
Pete
  • 1,289
  • 10
  • 18
1

Packet Sniff!!!! i dont think its any where near a solution for your problem.

create a javascript function which is called every time u click the ads, give some special class name and hook an onClick on the particular class to increment the click count and save it some how in a database or a file.

please make use of this link Logging hyperlink clicks on my website

Community
  • 1
  • 1
shajeeck
  • 121
  • 5
0

Packet sniffing opens up a whole host of potential issues. Attempting to run one on your server will most likely alert the security admins for your local network. It may not even work properly depending on the network setup. It could also get you kicked off the hosting provider.

Your best bet is the click logging with javascript mentioned by shajeeck. I am assuming it is a third party ad network.