1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Guide: How To Randomize Adsense Colors

Discussion in 'Placement / Reviews / Examples' started by Zedzero, Sep 27, 2006.

  1. ahkip

    ahkip Prominent Member

    Messages:
    9,205
    Likes Received:
    647
    Best Answers:
    0
    Trophy Points:
    310
    #21
    I know this might not be ture but what if google keep a record of the color combination when you generate the code? They can easily check if you have modify the code without using their code generator. Also, even though no one knows, you are still breaking the TOS.
     
    ahkip, Sep 28, 2006 IP
  2. Zedzero

    Zedzero Peon

    Messages:
    322
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #22
    i mailed google, and here is the answer:

    "...Please be sure that you
    don't make any changes on your own server which affect the display,
    behavior, targeting, or the AdSense code as it appears in the HTML source
    of your pages
    ..."

    that means, using this function is completely ok with adsense.
     
    Zedzero, Sep 29, 2006 IP
  3. EGS

    EGS Notable Member

    Messages:
    6,078
    Likes Received:
    438
    Best Answers:
    0
    Trophy Points:
    290
    #23
    This code does not violate any TOS from what I can tell.
    Now, allow me to state my reasoning. :)

    The code manipulates the color that the ad is displayed, and is random. Now, if the code hid or removed the Google Ad from the page, that would be against the TOS, but because it shows it and does not distort the ad, it is not.

    The coding does not affect the advertisers - in fact it may benefit them, as random colored advertisements would draw more and better attention to their ads.

    I think that if the background color became randomly the color of the text and URL and title of the ad, that would be against Google's TOS. But I'm pretty sure Google's javasacript detects that and fixes it automatically because I've run into an instance similar to that where Google displayed their own colored ad to make it readable with the background.

    :)
     
    EGS, Sep 29, 2006 IP
  4. Zedzero

    Zedzero Peon

    Messages:
    322
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #24
    thank you EGS.

    also, i tried my best to make sure that no color is same with background.

    color codes are variables between 0-255 for each color (red, green and blue), 255,255,255 being pure white.

    in my example, the closest possible color to the white is 200,200,200. as you can see:

    
    	$r = rand(0, 200);
    	$g = rand(0, 200);
    	$b = rand(0, 200);
    
    Code (markup):
    so the script can not make text colors same with background color. (this applies only if you have white background. you need to edit the numbers for other background colors as i said in my first post.)
     
    Zedzero, Sep 29, 2006 IP
  5. Vizuke

    Vizuke Peon

    Messages:
    339
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #25
    The code shouldn't violate the TOS. As others say, when you right-click view source you should only see the html code not the php parser codes. If it does, than we can just make an adsense rotation, and still thats not against the TOS.

    DP forums itself is doing this itself obviously. From changing the colors at the top right banner, you can tell it changes colors, etc.. from time to time and there has been no conflict with DP and Google from what I've seen so far. And as for revenue sharing feature in the DP forums, it is similar of generating a random color, but instead generating a random adsense client id from the DP members that have submitted their id's for revenue sharing.
     
    Vizuke, Sep 30, 2006 IP
  6. Zedzero

    Zedzero Peon

    Messages:
    322
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #26
    update:

    it's much more safer now:

    
    function randomcolor()
    {
    	$r = rand(0, 160);
    	$g = rand(0, 160);
    	$b = rand(0, 160);
    	
    	$r = base_convert($r, 10, 16);
    	$g = base_convert($g, 10, 16);
    	$b = base_convert($b, 10, 16);
    	
    	if (strlen(strval($r)) == 1) {$r = "0".$r;}
    	if (strlen(strval($g)) == 1) {$g = "0".$g;}
    	if (strlen(strval($b)) == 1) {$b = "0".$b;}
    	
    	$colorcode = $r.$g.$b;
    	echo($colorcode);	
    }
    
    Code (php):
     
    Zedzero, Sep 30, 2006 IP
  7. aleahey

    aleahey Member

    Messages:
    46
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #27
    They can't be keeping a record of your generated colors. If you click "Single Page" while setting up your Adsense code, the color combinations are changed in the code box in real time. No data is being sent back to Google, as you aren't submitting the form.

    On top of that, the logistics of keeping track of every change every Adsense publisher makes would render this near impossible. Google would need to double their resources just to either manually or automatically scan every publisher's page for deviations from the generated code.

    And, finally, what is the difference if you are breaking the TOS, if theres no way for them to know you are? Is it a moral issue?

    I would actually sort of look forward to St Peter questioning me on my Adsense color schemes. :p
     
    aleahey, Sep 30, 2006 IP
  8. Notorious

    Notorious Well-Known Member

    Messages:
    903
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    145
    #28
    Its better to do it like this --
    
    google_color_border = ["FFFF88","FF8888","8888FF","88FF88","CC0000","CC0000"]; 
    google_color_bg = ["FFFFCC","FFCCCC","CCCCFF","CCFFCC","FFFFFF","FFFFCC"]; 
    google_color_link = ["000066","000066","000066","000066","0000FF","000000"]; 
    google_color_text = ["222222","222222","222222","222222","006600","000000"]; 
    google_color_url = ["222222","222222","222222","222222","000000","000800"];
    Code (markup):
    No TOS issues & doesnt require PHP
     
    Notorious, Sep 30, 2006 IP
  9. EGS

    EGS Notable Member

    Messages:
    6,078
    Likes Received:
    438
    Best Answers:
    0
    Trophy Points:
    290
    #29
    PHP is a lot easier and does not violate TOS.
     
    EGS, Sep 30, 2006 IP
  10. fezbucks

    fezbucks Peon

    Messages:
    96
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #30
    this is awesome, thanks for posting this!
     
    fezbucks, Oct 3, 2006 IP
  11. Mystique

    Mystique Well-Known Member

    Messages:
    2,579
    Likes Received:
    94
    Best Answers:
    2
    Trophy Points:
    195
    #31
    PST, PST, have you seen the banner in the top right of your screen?.

    it changes color everytime!

    So whichever the method, I don't believe that could be a break of TOS :rolleyes:
     
    Mystique, Oct 3, 2006 IP
  12. artsky

    artsky Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #32
    ^^ i guess people have been ad-blind to that ad too :)
     
    artsky, Oct 4, 2006 IP