+1  A: 

Your question really isn't clear I'm afraid.

Are you trying to find out information on who uses your site, how many click you get and so one? Something like Google Analytics might be what you are after - take a look here http://www.google.com/analytics/

EDIT: Adding more info in response to comment.

Ah, OK, so you want to know how Google tracks clicks on sites when those sites use Google ads? Well, a full discussion on how Google AdSense works is well beyond me I'm afraid - you'll probably find some useful info on Google itself and on Wikipedia.

In a nutshell, and at a very basic level, Google Ads work by actually directing the click to Google first - if you look at the URL for a Google ad (on this site for example) you will see the URL starts with "http://googleads.g.doubleclick.net..." (Google own doubleclick), the URL also contains a lot of other information which allows Google to detect where the click came from and where to redirect you to see the actual web site being advertised.

Google analytics is slightly different in that it is a small chunk of JavaScript you run in your page, but that too basically reports back to Google that the page was clicked on, when you landed there and how long you spend on a page.

Like I said a full discussion of this is beyond me I'm afraid, sorry.

Steve Haigh
no no. I am a programmer. I want to write a web system like "google analytics" not to use them!let speack about AdScene: how google tracks number of clicks and impressions from another external website(for example a free blog service that registered to google to use AdScene)?any information?
mahdiahmadirad
+3  A: 

There are a few different ways to track clicks.

Redirection Tracking

One is to link the advertisement (or any link) to a redirection script. You would normally pass it some sort of ID so it knows which URL it should forward to. But before redirecting the user to that page it can first record that click in a database where it can store the users IP, timestamp, browser information, etc. It will then forward the user (without them really knowing) to the specified URL.

Advertisement ---> Redirection Script (records click) ---> Landing Page

Pixel Tracking

Another way to do it is to use pixel tracking. This is where you put a "pixel" or a piece of Javascript code onto the body of a webpage. The pixel is just an image (or a script posing as an image) which will then be requested by the user visiting the page. The tracker which hosts the pixel can record the relevant information by that image request. Some systems will use Javascript instead of an image (or they use both) to track clicks. This may allow them to gain slightly more information using Javascript's functions.

Advertisement ---> Landing Page ---> User requests pixel (records click)

Here is an example of a pixel: <img src="http://tracker.mydomain.com?id=55&amp;type=png" /> I threw in the png at the end because some systems might require a valid image filetype.

Hidden Tracking

If you do not want the user to know what the tracker is you can put code on your landing page to pass data to your tracker. This would be done on the backend (server side) so it is invisible to the user. Essentially you can just "request" the tracker URL while passing relevant data via the GET parameters. The tracker would then record that data with very limited server load on the landing page's server.

Advertisement ---> Landing Page requests tracker URL and concurrently renders page
Joe Philllips