![]() |
|
|
#1
|
||||
|
||||
|
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);
}
Code:
google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "<?randomcolor();?>"; google_color_text = "000000"; google_color_url = "000000"; Code:
$r = rand(0, 200); $g = rand(0, 200); $b = rand(0, 200); about google adsense tos: this can not put you in a difficult position against google, be assured.
__________________
Freelance Site for Coders and Webmasters |
|
#2
|
||||
|
||||
|
Quote:
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 |
|
#3
|
||||
|
||||
|
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.
__________________
Freelance Site for Coders and Webmasters |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
||||
|
||||
|
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
__________________
Freelance Site for Coders and Webmasters |
|
#6
|
||||
|
||||
|
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." |
|
#7
|
||||
|
||||
|
Quote:
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 |
|
#8
|
||||
|
||||
|
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>
__________________
Freelance Site for Coders and Webmasters |
|
#9
|
||||
|
||||
|
Quote:
Quote:
__________________
"I have come here to chew bubblegum and kick ass. And I'm all out of bubblegum." |
|
#10
|
||||
|
||||
|
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.
__________________
Freelance Site for Coders and Webmasters |
|
#11
|
||||
|
||||
|
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
|
|
#12
|
||||
|
||||
|
Quote:
__________________
"I have come here to chew bubblegum and kick ass. And I'm all out of bubblegum." |
|
#13
|
||||
|
||||
|
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
|
|
#14
|
|||
|
|||
|
without a email from google it means nothing
|
|
#15
|
|||
|
|||
|
cool, thanks!
|
|
#16
|
||||
|
||||
|
Quote:
Col
__________________
|
|
#17
|
|||
|
|||
|
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? |
|
#18
|
||||
|
||||
|
Quote:
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. |
|
#19
|
||||
|
||||
|
thankx this has been a cool thread
|
|
#20
|
|||
|
|||
|
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. |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
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 |