Forum Moderators: open

Message Too Old, No Replies

Rearranging Adsense ads using javascript recall

adsense javascript

         

investoblogger

3:11 am on Mar 20, 2009 (gmt 0)

10+ Year Member



Hello,

I have a blog on blogspot with adsense displayed on it. Unfortunately the ads with higher CTR on my blog appear later in the html code and with some javascript gimmick i want to rearrange the order in which adsense ad units appear in the html code without actually rearranging the ads. I think this is probably a piece of cake for those who know javascript. I have searched a lot but couldn't figure out how to do this. Can anyone of you help?

Thanks

whoisgregg

8:49 pm on Mar 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, investoblogger!

Messing with the javascript code itself is bound to get you in trouble with Google. One thing you could do easily (and is within the TOS) is wrap the adsense code in a <div> and use CSS to absolutely position it wherever you like on the page.

It's a little messy to do this on a hosted service because you'll also need to also change the CSS of the other elements to shift their position around.

In a nutshell though, that div might look something like this:

<div style="position: absolute; top: 100px; left: 100px;">
<!-- adsense code -->
</div>

Then just tweak the positioning. :)