Im running free webhosting server. Im trying to add Adsense ads on every users page, but its very nasty if user has page with frames (it ads to every page, so it can be 2 or 3 times on the same page). Not only its agaisnt Google TOS i think, but also it looks ugly. I also, have to run the same code for every page. I mean with frames or not. So i thought - what if this script will check window height and width, and if its more than lets say 500x350 or something like that, then it will run this Google Adsense script, and if not, it will not run it So even if this code adds itself to menu.html, it will not run becouse usually people dont make menu frames bigger than content frames And if it adds itself to page without frames - no problem, becouse window is always bigger than 500x350. And if its inside content.html from pages with frames, it should run once, becouse usually only one frame is so big What do you think, is it possible, and if yes, maybe someone have seen such thing? i was looking for it on hotscripts.com, or just googling, but without any luck
The other thing to watch if you're doing this automatically and not manually validating, is the hosted site abiding Google's TOS.
Google already told me its ok, and i saw many diffrent topics that this is ok, and Google has nothing agaisnt it. i was wondering, is it possible from the technical point of view and maybe do you know such script
If I were you, I'd be really careful to abide by the TOS... but that's your call. To implement it, you could put the entire user's page into a frameset, with your add at the top in one frame and the page below in another frame.
im not sure if this is the best idea... what about Google bots, wont they index only my forced html with framesets ? and what if someone is already in such page and will click on "MAIN PAGE"... it would load this frame again... i mean its doable, but thats seems like a very complicated project, that will check url refferer and stuff like that (and some people doesnt even show their referer - so i wont know from where they came from and i could load my frame with ads again) i've seen this on 1 or 2 free hosting sites - it was very messy. (websamba i think and one other site) after few clicks my page was full of their ads, to the point that it was unreadable.
Use javascript, just check screen width and height and if the window is big enough, call the adsense code, otherwise don't. See here
I remember seeing this same thread on another forum a year or so ago. Assuming you're using Apache, the correct way to do this involves fiddling with some of the configuration files. I don't remember any of the details (or even have thoughts about what terms to google, really). Everyone was making these sort of kludgy suggestions until someone popped up and said "Here's the answer, you dimwits." It's hard to find, but it's a very clean, elegant solution.