Write Adsense script into a single JS, is it against the TOS of google?

Discussion in 'Guidelines / Compliance' started by pv8848, Jan 19, 2006.

  1. #1
    Hi, I found some guy write the adsense script into a single JS file then just SRC the JS file when needed, I think it's really cool but I don't know if it is against the TOS or not , have any ideal about this?:confused:

    The script is as following
    document.writeln("<script type=\"text\/javascript\"><!--");
    document.writeln("google_ad_client = \"pub-blahblahbalh\";");
    document.writeln("google_alternate_ad_url = \"http:\/\/blahblahblah\/blah.htm\";");
    document.writeln("google_ad_width = 728;");
    document.writeln("google_ad_height = 90;");
    document.writeln("google_ad_format = \"728x90_as\";");
    document.writeln("google_ad_channel =\"\";");
    document.writeln("google_color_border = \"FF8A39\";");
    document.writeln("google_color_bg = \"FFFFFF\";");
    document.writeln("google_color_link = \"0000FF\";");
    document.writeln("google_color_url = \"008000\";");
    document.writeln("google_color_text = \"000000\";");
    document.writeln("\/\/--><\/script>");
    document.writeln("<script type=\"text\/javascript\"");
    document.writeln(" src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script>")
     
    pv8848, Jan 19, 2006 IP
  2. stereotaxis

    stereotaxis Peon

    Messages:
    58
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This can't be legal, since you are altering the adsense code.

    But you can do the same thing on a server side. With PHP.
    Then, the client will only see the adsense code.

    if ($show_ads) {
    
    echo "google.....";
    
    }
    
    PHP:
    This way you can dynamically alter something in the ads, like color. or show different type of ad.

    You can use this when I want to adjust the background of the ad to the background of the page, dynamically.
     
    stereotaxis, Jan 19, 2006 IP
  3. pv8848

    pv8848 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks , that must be cool, but ... I am running an asp server :(

    I like php , that is why I am learning it now :)
     
    pv8848, Jan 19, 2006 IP
  4. Joobz

    Joobz Peon

    Messages:
    598
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'm not sure I follow you on this - I have created a file called "adsense.inc" and that is where my adsense code is located, any page I want adsense on, I just place and include statement for adsense.inc, am I doing something against TOS here?
     
    Joobz, Jan 19, 2006 IP