How Google Adsense Works

What you add for showing google ads on your website ? It is a javascript , right ?

JavaScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<script type="text/javascript"><!--
google_ad_client = "pub-2389xxxxxxxx";
google_ad_width = 200;
google_ad_height = 200;
google_ad_format = "200x200_as";
google_ad_type = "text";
//2007-09-26: PG G L
google_ad_channel = "46xxxxx";
google_color_border = "EEEEEE";
google_color_bg = "EEEEEE";
google_color_link = "0000FF";
google_color_text = "000000";
google_color_url = "008000";
google_ui_features = "rc:10";
//-->
</script>

Parameters are: Client Id
format, channel,url for the caller webpage, background color, link color, border color, text color, javasupport, flash support etc

The width and height of the iframe is calculated from google_ad_width = 468 and google_ad_height = 60 parameters.

This is not the end of the story. The actual story just begins now. The loading iframe contains all the advetisement according to your adsense configuration. If you check the links of add unit, you can see all the event with the link is tracked by google adsense code.

See a sample ad link:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
&lt;a id=aw0 class=adt target=_top onmouseover=return ss(,aw0)
onmousedown=st(aw0) onfocus=ss(,aw0) onclick=ha(aw0)
href=http://pagead2.googlesyndication.com/pagead/iclk?sa=l&amp;ai=
BW7_Ir6xGSKf3Npz6vQOespnnDdO6yVvXoIDxAs
CNtwGgnAEQARgBIL3C4wMoAjgAUKnM2_f6_____
wFg5aLmg7gOoAHNhrj5A7IBEHd3dy5zYWppdGhtci5jb226AQk0Njh4NjBfYXPIA
QHaAT9odHRwOi8vd3d3LnNhaml
0aG1yLmNvbS9kb3dubG9hZC15b3V0dWJlLXZpZGVvcy11
c2luZy1waHAtY29kZS_gAQKAAgGoAwHIAwfoAx_oA_g
D6AOmA-gDBegDDfUDCAAQAYgEAZAEAZgEAA&amp;num=1&amp;
adurl=http://www.codango.com/
&amp;client=ca-pub-2389393537983674&amp;nm=5&gt;
&lt;span&gt;Free PHP Code &amp; Scripts&lt;/span&gt;
&lt;/a&gt;

Free PHP Code & Scripts
See onmouseover, onfocus, onmouseout etc functions are used. It means google studies user behaviour with google ads. The click on the link does not go directly into the corresponding website, instead it redirected inot googlesyndication.com and from then redirected into real website. You can guess the reason.

Depending on your browser configuration, google shows text ads, image ads and flash (shock wave) ads

This is a very small introduction of hows adsense works. There are a lot of steps behind the show_ad.js file. But this is will give you a rough idea.

I think

Regards

Sajith.M.R

7 Comments , , ,

7 Responses to “How Google Adsense Works”

  1. Jash Sayani June 9, 2008 at 12:08 pm #

    Thanks! That was cool !
    I never observed the javascript so closely ! :)

  2. Mark June 10, 2008 at 10:59 am #

    That was good. I have spent time learning SEO and google adsense optimization which I have discussed in my blog MindRivet but this is good – understanding how what works!

  3. Raja June 10, 2008 at 4:19 pm #

    Brilliant observation. All of the post are excellent.

  4. Sudhi July 24, 2008 at 8:32 pm #

    hi sajith,

    can you make it more clear please, can you tell me how people make money from this and how exactly it works.

    Thanks,
    Sudhi

  5. soregrapes October 16, 2008 at 1:55 am #

    great explanation sajith, that gives me the basic knowledge of how google can track us. very impressive,keep it up and keep coming more

  6. Harender Singh January 18, 2009 at 4:03 pm #

    can you make it more clear please, can you tell me how people make money from this and how exactly it works.

  7. Caramoan Tour Package Blog December 25, 2009 at 8:12 am #

    I recently added an Adsense square ads on my travel blog. my adsense earning is still low since i dont have large volume of internet traffic yet.
    `

Leave a Reply

More in html, webworld (37 of 72 articles)


Yesterday i just started a tool for measuring some services of google. This small tool / needle , I ...