How to Insert Code into RSS feed for Ads (from ad server) (11 posts)

  1. fmckinnon
    Posted 6 years ago #

    Hey Gang,
    We use OpenX.org as our ad server, and it works great serving up banners on the websites. Our Ad agency is wanting to book campaigns in our RSS feeds now - I have no clue what file to edit, and where/how to insert the code.

    The code is typically either a javascript or iframe code ...

    We want the code to render the ads at the bottom of each article in the RSS feed.

    Thanks in advance,

  2. See http://www.smashingmagazine.com/2008/12/02/10-useful-rss-hacks-for-wordpress/

    Look at #3: Insert Ads (or Anything Else) in Your RSS Feed

  3. fmckinnon
    Posted 6 years ago #

    Thanks a ton - I've done this, and I'm assuming my ad-server code I placed in my functions.php file is OK, because i'm not getting any errors (at first, when I attempted to use the javascript of iframe code, it wouldn't work - so I'm using a simpler "image tag" code now).

    But - nothing is showing up:

    Here's the functions.php code:

    if ( function_exists('register_sidebars') )

    function insertAds($content) {
    $content = $content.'<hr /><img src="http://d1.openx.org/avw.php?zoneid=81644&n=ac3c8466"><hr />';
    return $content;
    add_filter('the_excerpt_rss', 'insertAds');
    add_filter('the_content_rss', 'insertAds');

  4. Works for me.


    There's usually a lag with feedburner updates :)

  5. fmckinnon
    Posted 6 years ago #

    Interesting - yep, it works for me to if I load feeds.feedburner.com/fredmckinnon - but when I view my own feed in Google Reader, it only shows the Google Ads.

    And since I assume most folks will be using Google Reader, I wonder if there's a way to resolve that?

    Can you try subscribing in Google Reader to see if it works there?

  6. fmckinnon
    Posted 6 years ago #

    PS: incidentally,
    I've subscribed to my RSS in Net News Wire and Apple Mail app, neither of which show the ads either. It seems that they make it to feedburner, and then disappear once picked up there. Maybe Feedburner is removing them?

  7. You can't have both google ads AND your custom ads at the same time (among other things, it's a violation of Google's TOS).

  8. fmckinnon
    Posted 6 years ago #

    Gotcha - I've turned off the GoogleAds, but it didn't seem to make a difference, so I turned them back on.

  9. Just remember, it can take up to 24 hours for FeedBurner to stop being a retard and recache things.

  10. fmckinnon
    Posted 6 years ago #

    feedburner actually shows the updates very quickly ... but the ads never come through into GoogleReader. I'm guessing it's a Google thing.

  11. Gouri
    Posted 6 years ago #

    Thanks a lot. My blog was in need of this for a long time.

Topic Closed

This topic has been closed to new replies.

About this Topic