Forum Moderators: martinibuster

Message Too Old, No Replies

Dynamic inserted 120x600 for big screens

An additional 120x600 AdSense only for big screens

         

jetteroheller

7:36 am on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



German web statistic tells:

1024 x 768 59.5%
1280 x 1024 22.7%
800 x 600 6.7%
1152 x 864 5.3%
1600 x 1200 2.2%
other 3.6%

So I could place an add on any screen biger than
1024+120 width. This is about 1/3 of all visitors.
Most of the 3,6% other could be notebooks with
1400x1050 or 1280x800 wide screen of 1440x960 wide screen.

This additional add should only be shown on big screens, because I do not want horizontal scrolling.

So any idea how to make this?

Powdork

8:18 am on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know if you can dynamically insert another box into a page based on screen res but you can redirect to a different page based on screen res and that can be based on a template with another adsense box on it. In your head something to the effect of

<SCRIPT LANGUAGE="JavaScript">
<!--
if (screen.width < 1024) { window.location="oneadsensebox/index.htm";
}

if (screen.width >= 1025) { window.location="extraadsensebox/index.htm";
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
Of course you'll want to disallow Googlebot to one of the directories while making sure to ot disallow mediapartners bot.

jetteroheller

8:55 am on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I thought more on something in Java Script

if (screen.width >= 1025) {

document.write ( "Here goes the AdSense Code" );

}

But because the AdSense Code is in "", it would be necessary to \" all " in the AdSense code, what could be seen as a change of the code.

I search for a solution, to make it like this, but within TOS

maximillianos

1:29 pm on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could use single quotes like below and get away with not having to insert the backslash...

document.writeln('channel="3993";');

Still not sure about the TOS compliance...;-)

killroy

5:44 pm on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I never run browsers full screen on anything bigger the 800x600. Your logic is fundamentall flawed.

SN

MrAnchovy

6:12 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



1) Get screen size from javascript
2) Set screen res cookie
3) Ask for cookie on all pages (via php)
4) Serve page based on cookie's stated screen res

So... depending on what the cookies says, I serve a content area of either either 760px in width (for 800x600 res) or 955px in width (for 1024x768 & greater res).... with the only difference being an extra column for another adsense block.

An easy way to do add this to an existing site is to place your already-existing content into a table.
For example, you would use the following on your old page:
<table>
<tr>
<td width="760"><!-- existing content goes here --></td>
</tr>
</table>

If the cookie, indicated a larger screen res, you would simply make the changes listed in bold:
<table>
<tr>
<td width="760"><!-- old page goes here --></td>
<td width="195"><!-- new column here --></td>
</tr>
</table>

This new table could wrap your entire page... or just the content portion between top & bottom headers... each site is going to be unique in how exactly it is implemented, but the above gives you the general idea of one way to go about it.

With the combined use of javascript, cookies, and php, adding that extra column for larger screen res isn't terribly difficult... however, does require editting of your existing pages.... which in my own experience, is well worth the effort due to the extra impressions/clicks that it will generate.

If you already use fixed-width table sizes (ie. width=760)... you could merely add a php-include that contained the new AdSense block... and position it with CSS wihout having to modify your existing table stucture.
However, if you used a relative table-width (ie. width=90%), you would have to make the edits depending on the size... as positioning the extra AdSense block via CSS would most-likely cause it to be placed on top of your existing content.