# Banner Ad Management in Ruby/Rails?

**URL:** <https://www.ruby-forum.com/t/banner-ad-management-in-ruby-rails/76710>\
**Category:** Rails\
**Created:** [November 20, 2006, 4:54pm UTC](https://www.ruby-forum.com/t/banner-ad-management-in-ruby-rails/76710 "2006-11-20T16:54:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![superwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@superwick](https://www.ruby-forum.com/u/superwick)\
**Post date:** [November 20, 2006, 4:54pm UTC](https://www.ruby-forum.com/t/banner-ad-management-in-ruby-rails/76710/1 "2006-11-20T16:54:55Z")

</div>

Hello,

Does anyone know of a plugin or gem for banner ad rotation management?  
Something inthe vein of PhpAds. I’ve searched and searched and come up  
with nothing. I thought I’d check here before I “roll my own”.

Any tips from others who have done this?

Thanks!  
-Chad

---

<div class="post-metadata">

**Author:** ![superwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@superwick](https://www.ruby-forum.com/u/superwick)\
**Post date:** [November 20, 2006, 6:19pm UTC](https://www.ruby-forum.com/t/banner-ad-management-in-ruby-rails/76710/2 "2006-11-20T18:19:22Z")

</div>

We didn’t find anything, so ended up rolling our own.

What we did was have partials for the ad types we wanted and then had a  
db entry system to enter in a block of html and assign it an ad type,  
priority and expire date. We also added code that if it found multiple  
ads of the same type and priority that it would randomize which one it  
displays.

Ray

> **[Pop Current](https://popcurrent.com/)**
>
> Popping the Current Trends

---

<div class="post-metadata">

**Author:** ![superwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@superwick](https://www.ruby-forum.com/u/superwick)\
**Post date:** [November 21, 2006, 2:39pm UTC](https://www.ruby-forum.com/t/banner-ad-management-in-ruby-rails/76710/3 "2006-11-21T14:39:06Z")

</div>

Thanks!

Did you also add ad-view “clickthru” tracking? This is the part I have  
no idea how to do…

The site I’m working on redesigning (from php to RoR) currently has  
phpads, and has paid advertisers that rely on stats to see how  
effective their ads are.

---

<div class="post-metadata">

**Author:** ![superwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@superwick](https://www.ruby-forum.com/u/superwick)\
**Post date:** [November 21, 2006, 2:57pm UTC](https://www.ruby-forum.com/t/banner-ad-management-in-ruby-rails/76710/4 "2006-11-21T14:57:10Z")

</div>

On 11/21/06, Chad W [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks!
> 
> Did you also add ad-view “clickthru” tracking? This is the part I have  
> no idea how to do…

Point the banner at your app, e.g. link\_to , :controller =\>  
“banner”, :action =\> “click”, :id =\> @banner.id …

Have the click action register the click somehow, then redirect\_to  
whatever url the banner should take one too.

Isak

---

<div class="post-metadata">

**Author:** ![superwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@superwick](https://www.ruby-forum.com/u/superwick)\
**Post date:** [November 21, 2006, 6:50pm UTC](https://www.ruby-forum.com/t/banner-ad-management-in-ruby-rails/76710/5 "2006-11-21T18:50:16Z")

</div>

> The site I’m working on redesigning (from php to RoR) currently has  
> phpads, and has paid advertisers that rely on stats to see how  
> effective their ads are.

Why not keep using phpads? It works well, is a known quantity and can  
be  
easily integrated into Rails. We wrote a little helper method  
“render\_banner()” that you can pass a size, zone, refresh, etc to that  
works very nicely. One of the nice things about it is that we wrap the  
whole banner into an iframe so it protects our site from those HTML  
banners that blow the page to pieces.

If you’re interested let me know and I can dig it up…

---

<div class="post-metadata">

**Author:** ![superwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@superwick](https://www.ruby-forum.com/u/superwick)\
**Post date:** [November 24, 2006, 4:16pm UTC](https://www.ruby-forum.com/t/banner-ad-management-in-ruby-rails/76710/6 "2006-11-24T16:16:07Z")

</div>

We didn’t track ads, since most of the ads were from ad services not  
our own but its probably a good idea 😉 Isak’s email about how to  
track seems like a solid solution.
