Skip to content

Adsense Injection MOD


Dax Herrera had written a great Adsense Injection WordPress plugin that injects Google ads in WordPress.

The only problem that it tends to break the code if a post does not begin with a <p> tag.
This prompted me to start modding the plugin and I got a bit carried away and after about four hours added some more stuff to it. So here we go:

Added

  • $marker into replacement procedure instead of <p> so it won’t be breaking the whole thing if a post starts with something other than <p>
  • 336×280 Large Rectangle format
  • Alternative Colour and Alt URL options (if no URL – goes for color, if no color – goes FFFFFF)
  • text, text_image, image, options
  • CSS formatting – top bottom inner outer
  • ads not shown in preview

Changed

  • increased the number of ads from 3 to 4 (probably pointless)
  • ad channel outputs only when channel is set
  • re-ordered formats (as in Google) plus added format names
  • minor cosmetic HTML changes

Download it here: Adsense Injection MODed by LZZR

6 Comments

  1. jaja wrote:

    hi I downloaded you mod of the adsense but i have observed that whenever i clicked on the large rectangle option the settings could not be saved…

    any ideas? my webby is Got Recipe!

    Thursday, July 6, 2006 at 8:08 pm | Permalink
  2. lzzr wrote:

    Could you be just a bit more specific? :-)
    Just which large rectangle do you mean?

    Wednesday, July 12, 2006 at 4:38 pm | Permalink
  3. As far as I know the max number of ad blocks allowed is three.
    but you are also allowed to have a link ad block as well for a total of 4.

    that’s per page, if your article is split across a few pages this rule won’t matter.

    Saturday, November 25, 2006 at 9:49 am | Permalink
  4. lzzr wrote:

    If I understand you right you are worried about Google’s 3 blocks limitation. Well my version does not force 4 blocks – you can choose the number of ad blocks yourself. Is this what you are asking about or I missed the point?
    You see, i’ve been under a bit a bit of a pressure lately :-) so honestly can’t remember what exactly I did to Dax’s plugin (just know that I made it a bit better than it was) but I know he released a couple of new versions since. AFAIK he did not implement everything I did so as soon as I’l have time I’ll take a look at his updates and most likely will mod it again and release my fork.

    Monday, November 27, 2006 at 3:22 pm | Permalink
  5. That’s exactly what I was talking about. It seemed strange to me to give people the option to try and put 4 ads on a page when it’s against the Goog’s TOS.

    I’m not really complaining :)
    but if there are people who don’t bother knowing these things before signing up I wouldn’t like to see them get banned or reprimanded.

    Tuesday, November 28, 2006 at 7:02 am | Permalink
  6. lzzr wrote:

    Just got back to this – I don’t think Google will punish anyone for having a block or two extra ;-) LOL
    It’s like shooting oneself in the foot.
    After all they will simply stop showing their ad in 5th block.
    There is one possible drawback though. Having too many blocks may dilute your click value, so that you’ll be getting cheaper clicks.
    Use it at your own risk anyway.
    PS I will definetly check and re-mod this plugin again since I am at the moment modding everything because of the upgrade to WordPress 2.1

    Wednesday, January 31, 2007 at 5:02 am | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*