Money-Code

Coding For Online Success

Google Adsense – How to randomize theme

| 2 Comments

A few conversations about changing and ad placement to help prevent banner blindness has led to me to create this simple script to automatically randomize a Google AdSense block. This is a extremely easy script that uses a array of values, randomizes the index and puts the values into the AdSense block. This could be modified to include random ad formats as well as optionally including Video units, etc.

I’ve rolled this out on one of my sites to see what ad format color scheme might be the best. I’m tracking results by providing a channel to see what gets good clicks and what themes do not.

span class=”st0″>’pub-0000000000000001′‘120x240_as’;
$adType                                 = ‘text’‘bc’]           = ‘FCFCFC’‘bg’]         = ‘286EA0’‘link’]               = ‘286EA0’‘text’]               = ‘E6E6E6’‘url’]                = ‘FFFFCC’‘channel’]    = ‘blue’‘misc’]         = ‘rc:6’‘bc’]           = ‘FFFF66’‘bg’]         = ‘FFCC66’‘link’]               = ‘FFFFFF’‘text’]               = ‘000000’‘url’]                = ‘FFFFFF’‘channel’]    = ‘yellow’‘misc’]               = ‘rc:10’‘bc’]          = ‘FFFF66’‘bg’]         = ‘CC0000’‘link’]               = ‘FFFFFF’‘text’]               = ‘000000’‘url’]                = ‘FFFFCC’‘channel’]    = ‘red’‘misc’]          = "text/javascript""<?=$pubID?>""<?=$adFormat?>""<?=$adType?>""""<?=$adArray[$index][‘bc’]?>""<?=$adArray[$index][‘bg’]?>""<?=$adArray[$index][‘link’]?>""<?=$adArray[$index][‘text’]?>""<?=$adArray[$index][‘url’]?>"‘misc’"<?=$adArray[$index][‘misc’]?>"//–>
"text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"

2 Comments

Leave a Reply

Required fields are marked *.


CommentLuv badge

This site uses Akismet to reduce spam. Learn how your comment data is processed.