Digital Point Forums
Money Transfer

Go Back   Digital Point Forums > Search Engines > Google > AdSense > Placement / Reviews / Examples
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Sep 27th 2006, 9:45 am
Zedzero's Avatar
Zedzero Zedzero is offline
Hand of A'dal
 
Join Date: Aug 2005
Posts: 322
Zedzero is on a distinguished road
Guide: How To Randomize Adsense Colors

Well, nothing complicated here. this is just a simple php function. every coder can code it in under a minute, but i'm writing this for those who can't I coded it for myself, and thought some may find it useful.

what does it do:
it randomizes any color of your ads for each visitor, each time.

what you will need:
1. a host that supports php

steps
1. add this function to wherever your functions are, or to the page you have adsense ads.

Code:
function randomcolor()
{
	$r = rand(0, 200);
	$g = rand(0, 200);
	$b = rand(0, 200);
	
	$colorcode = base_convert($r, 10, 16).base_convert($g, 10, 16).base_convert($b, 10, 16);
	echo($colorcode);	
}
2. when adding your adsense code, edit it like this:

Code:
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "<?randomcolor();?>";
google_color_text = "000000";
google_color_url = "000000";
you can apply <?randomcolor();?> to any other color codes as you wish. but be advised that, currently it is optimized for white background. if you wish to change it, you may need to edit those 3 lines:

Code:
$r = rand(0, 200);
$g = rand(0, 200);
$b = rand(0, 200);
they generate colors which are not so close to white, so that google will not use default colors instead of yours.

about google adsense tos:
this can not put you in a difficult position against google, be assured.
Reply With Quote
  #2  
Old Sep 27th 2006, 9:55 am
hans's Avatar
hans hans is offline
Starcaller
 
Join Date: Mar 2004
Location: Philippines
Posts: 2,622
hans is just really nicehans is just really nicehans is just really nicehans is just really nicehans is just really nice
Quote:
Originally Posted by Zedzero View Post
Code:
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "<?randomcolor();?>";
google_color_text = "000000";
google_color_url = "000000";
you can apply <?randomcolor();?> to any other color codes as you wish. but be advised that, currently it is optimized for white background. if you wish to change it, you may need to edit those 3 lines:


about google adsense tos:
this can not put you in a difficult position against google, be assured.

TOS
after all you are actually CHANGING the original google code
hence i would never be that sure about your TOS compliance

and since there are other options - like the original Google oprions to change colors ....

did you actually verify the TOS compliance with a formal request to Google about your precise example or is this just an assumption
Reply With Quote
  #3  
Old Sep 27th 2006, 9:58 am
Zedzero's Avatar
Zedzero Zedzero is offline
Hand of A'dal
 
Join Date: Aug 2005
Posts: 322
Zedzero is on a distinguished road
i saw it coming

google tos is based on making html edits. this is a server based edit, that will OUTPUT code compliant to TOS.

if you apply this and then view your sites source code, you will see that it is TOS compliant.
Reply With Quote
  #4  
Old Sep 27th 2006, 10:13 am
hans's Avatar
hans hans is offline
Starcaller
 
Join Date: Mar 2004
Location: Philippines
Posts: 2,622
hans is just really nicehans is just really nicehans is just really nicehans is just really nicehans is just really nice
that means you did NOT really verify this particular sample with Google
Google however is open to respond to such kind of requests for clarification
a long time ago i did a different approach and submitted for clarification to Google and got an official approve

it maintains peace of mind to have such
the output is the same - but the original code IS modified
Reply With Quote
  #5  
Old Sep 27th 2006, 10:39 am
Zedzero's Avatar
Zedzero Zedzero is offline
Hand of A'dal
 
Join Date: Aug 2005
Posts: 322
Zedzero is on a distinguished road
i understand your concern.

i gave my word on compliance, and made my point regarding code edits. if you don't trust my word, it is understandable that you don't use this little code.

btw, it is also possible to do that without editing code. but i didn't need it since i trust my own word
Reply With Quote
  #6  
Old Sep 27th 2006, 10:43 am
jackburton2006's Avatar
jackburton2006 jackburton2006 is offline
Astral Walker
 
Join Date: Nov 2005
Posts: 5,297
jackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud of
Yet another superfluous breaking of the TOS in the service of God knows what reason. If you're going to risk getting ban from such a potentially valuable program, then at least do it for a big reward, not just changing your banner colors.
__________________
"I have come here to chew bubblegum and kick ass. And I'm all out of bubblegum."
Reply With Quote
  #7  
Old Sep 27th 2006, 11:02 am
hans's Avatar
hans hans is offline
Starcaller
 
Join Date: Mar 2004
Location: Philippines
Posts: 2,622
hans is just really nicehans is just really nicehans is just really nicehans is just really nicehans is just really nice
Quote:
Originally Posted by Zedzero View Post
i understand your concern.

i gave my word on compliance, and made my point regarding code edits. if you don't trust my word, it is understandable that you don't use this little code.

btw, it is also possible to do that without editing code. but i didn't need it since i trust my own word
myself i have NO need to use your code
my concern are for all others who might want to try it
your word in God's ears - but your word might cost millions of $ if several people use the code and would get banned by G for TOS violation and refer to your word to refund in full their lifetime adsense NON-revenue ...

i would never do such changes without real and direct Google aproval - its free and just an email to G to get it and to get peace of mind for all and to be free of an $ liability for your word
Reply With Quote
  #8  
Old Sep 27th 2006, 11:06 am
Zedzero's Avatar
Zedzero Zedzero is offline
Hand of A'dal
 
Join Date: Aug 2005
Posts: 322
Zedzero is on a distinguished road
you really don't know the difference between server-side code and simple html, right?

can you tell whether the following code is edited or not? DOES it matter if you can tell?

Code:
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxx";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
google_ad_channel ="xxxxxxxxxx";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_text = "000000";
google_color_url = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
Reply With Quote
  #9  
Old Sep 27th 2006, 1:02 pm
jackburton2006's Avatar
jackburton2006 jackburton2006 is offline
Astral Walker
 
Join Date: Nov 2005
Posts: 5,297
jackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud of
Quote:
Originally Posted by Zedzero View Post
you really don't know the difference between server-side code and simple html, right?
What I want to know is, how you can make a statement like this:

Quote:
Originally Posted by Zedzero
about google adsense tos:
this can not put you in a difficult position against google, be assured.
Without proof of Google telling you it's okay. If some noob uses this because of your assurances, and he gets banned or warned against it, what's he going to say, "B-b-b-but Zedzero assured me it wasn't against the TOS!" Give me a break and stop making bold pronouncements that you can't back up.
__________________
"I have come here to chew bubblegum and kick ass. And I'm all out of bubblegum."
Reply With Quote
  #10  
Old Sep 27th 2006, 1:06 pm
Zedzero's Avatar
Zedzero Zedzero is offline
Hand of A'dal
 
Join Date: Aug 2005
Posts: 322
Zedzero is on a distinguished road
i gave my word and you told your concerns clearly.
i think now noobs can decide on their own with the knowledge of both side of the story.
Reply With Quote
  #11  
Old Sep 27th 2006, 1:13 pm
daniah's Avatar
daniah daniah is offline
of the Nightfall
 
Join Date: Aug 2005
Posts: 1,085
daniah is on a distinguished road
There is no question of anyone getting banned by using this piece of code. This code is run on the server side and simply selects a random color, the output of the code is 100% google compliant, this can easily be verified by looking at the output of the code which is perfectly legit
__________________
PR LINKS
Reply With Quote
  #12  
Old Sep 27th 2006, 1:21 pm
jackburton2006's Avatar
jackburton2006 jackburton2006 is offline
Astral Walker
 
Join Date: Nov 2005
Posts: 5,297
jackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud ofjackburton2006 has much to be proud of
Quote:
Originally Posted by daniah View Post
There is no question of anyone getting banned by using this piece of code. This code is run on the server side and simply selects a random color, the output of the code is 100% google compliant, this can easily be verified by looking at the output of the code which is perfectly legit
Again, how can you say that? Why don't you and the other guy Email Adsense Support about this, then come back with the answer. THEY are the only ones who can give assurances, and even then they can change their minds tomorrow.
__________________
"I have come here to chew bubblegum and kick ass. And I'm all out of bubblegum."
Reply With Quote
  #13  
Old Sep 27th 2006, 1:33 pm
daniah's Avatar
daniah daniah is offline
of the Nightfall
 
Join Date: Aug 2005
Posts: 1,085
daniah is on a distinguished road
Quote:
Originally Posted by jackburton2006 View Post
Again, how can you say that? Why don't you and the other guy Email Adsense Support about this, then come back with the answer. THEY are the only ones who can give assurances, and even then they can change their minds tomorrow.
The adsense support comes into picture if you make any changes in the adsense code displayed on a page. Since the adsense code which will appear on the page is strictly per TOS there will be no problems
__________________
PR LINKS
Reply With Quote
  #14  
Old Sep 27th 2006, 4:20 pm
ahkip ahkip is offline
Astral Walker
 
Join Date: Feb 2006
Location: vBulletinSetup.com
Posts: 9,192
ahkip is just really niceahkip is just really niceahkip is just really niceahkip is just really niceahkip is just really nice
Quote:
Originally Posted by daniah View Post
The adsense support comes into picture if you make any changes in the adsense code displayed on a page. Since the adsense code which will appear on the page is strictly per TOS there will be no problems
without a email from google it means nothing
Reply With Quote
  #15  
Old Sep 28th 2006, 12:52 am
Mike32 Mike32 is offline
Peon
 
Join Date: Dec 2005
Posts: 17
Mike32 is on a distinguished road
cool, thanks!
Reply With Quote
  #16  
Old Sep 28th 2006, 12:57 am
Cheap SEO Services's Avatar
Cheap SEO Services Cheap SEO Services is offline
<------DoFollow Backlinks
 
Join Date: Feb 2006
Location: In The....SEO Taxi Dot Com
Posts: 16,645
Cheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond reputeCheap SEO Services has a reputation beyond repute
Quote:
Originally Posted by jackburton2006 View Post
Again, how can you say that? Why don't you and the other guy Email Adsense Support about this, then come back with the answer. THEY are the only ones who can give assurances, and even then they can change their minds tomorrow.
You are right once again. It does not matter what anyone says what GA will or will not do. It is safe and easy to flick them an email to get it in concrete!

Col
__________________
Web Hosting - Wordpress Themes
2 SIG SPOTS $140 each
Reply With Quote
  #17  
Old Sep 28th 2006, 3:42 am
gmeyer gmeyer is offline
Peon
 
Join Date: Jun 2006
Posts: 7
gmeyer is on a distinguished road
I use to rotate colors and even different ads (Google/Amazon) by
randomly including different unchanged snippets of code
via PHP. I never had any problems (or even concerns) about that
practice, because the delivered html-code definitely is complying
with all the Google rules.

Now my concerns are rising ;-)
What do you think about that?
Reply With Quote
  #18  
Old Sep 28th 2006, 4:47 am
hans's Avatar
hans hans is offline
Starcaller
 
Join Date: Mar 2004
Location: Philippines
Posts: 2,622
hans is just really nicehans is just really nicehans is just really nicehans is just really nicehans is just really nice
Quote:
Originally Posted by gmeyer View Post
I use to rotate colors and even different ads (Google/Amazon) by
randomly including different unchanged snippets of code
via PHP. I never had any problems (or even concerns) about that
practice, because the delivered html-code definitely is complying
with all the Google rules.

Now my concerns are rising ;-)
What do you think about that?
that is the normal way to do and fully approved by Google.
this method of randomly selecting a complete original google adsense code with different color palette has been discussed much earlier in another thread here in DP forum

by then I have submitted the procedure howto SSI adsense to Google and received a friendly positive reply which is published as well for general reference in above linked page.
Reply With Quote
  #19  
Old Sep 28th 2006, 5:36 am
010081's Avatar
010081 010081 is offline
Banned
 
Join Date: Jun 2006
Location: www.watchanytv.com
Posts: 4,671
010081 has much to be proud of010081 has much to be proud of010081 has much to be proud of010081 has much to be proud of010081 has much to be proud of010081 has much to be proud of010081 has much to be proud of010081 has much to be proud of
thankx this has been a cool thread
Reply With Quote
  #20  
Old Sep 28th 2006, 1:17 pm
aleahey aleahey is offline
Grunt
 
Join Date: Sep 2006
Posts: 46
aleahey is on a distinguished road
I find it disturbing that so many people have such a small amount of knowledge of PHP and server-side coding.

There would be no way for Google to tell you were using this.
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adsense Colors / Changing colors Advice huntz Placement / Reviews / Examples 0 Mar 29th 2006 4:36 am
Randomize Data in An Array qdsouza PHP 5 Sep 1st 2005 4:49 pm
Adsense colors gbh1935 AdSense 6 Aug 16th 2005 7:09 pm
Getting the colors right with Adsense islandhopper Placement / Reviews / Examples 5 Feb 25th 2005 12:19 pm
AdSense Colors digitalpoint Suggestions & Feedback 10 May 13th 2004 3:31 pm


All times are GMT -8. The time now is 11:30 am.