# Managing ads banner

**URL:** <https://www.ruby-forum.com/t/managing-ads-banner/162779>\
**Category:** Rails\
**Created:** [March 13, 2009, 5:37pm UTC](https://www.ruby-forum.com/t/managing-ads-banner/162779 "2009-03-13T17:37:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![semyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce7236/32.png) [@semyou](https://www.ruby-forum.com/u/semyou)\
**Post date:** [March 13, 2009, 5:37pm UTC](https://www.ruby-forum.com/t/managing-ads-banner/162779/1 "2009-03-13T17:37:49Z")

</div>

Hi guys,

What is the best way to include ad banners in rails? Do you include them  
in default layout? What is the ideal way if the ad has to change each  
time?

Thanks,

---

<div class="post-metadata">

**Author:** ![semyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce7236/32.png) [@semyou](https://www.ruby-forum.com/u/semyou)\
**Post date:** [March 13, 2009, 6:36pm UTC](https://www.ruby-forum.com/t/managing-ads-banner/162779/2 "2009-03-13T18:36:02Z")

</div>

> What is the best way to include ad banners in rails? Do you include  
> them  
> in default layout? What is the ideal way if the ad has to change each  
> time?

My advice would be to not to do it. Tie Rails into an existing ad  
server. You really don’t want to have to write your own ad server if  
you can avoid it.

You may find this useful:  
[http://pjkh.com/articles/2006/12/21/integrating-openads-with-rails](http://pjkh.com/articles/2006/12/21/integrating-openads-with-rails)

I’m assuming you want to sell your own banners, otherwise integrating  
Google Adsense or similar is as simple as just dropping in the code.

-philip

---

<div class="post-metadata">

**Author:** ![semyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce7236/32.png) [@semyou](https://www.ruby-forum.com/u/semyou)\
**Post date:** [March 13, 2009, 7:13pm UTC](https://www.ruby-forum.com/t/managing-ads-banner/162779/3 "2009-03-13T19:13:42Z")

</div>

Philip H. wrote:

> > What is the best way to include ad banners in rails? Do you include  
> > them  
> > in default layout? What is the ideal way if the ad has to change each  
> > time?
> 
> My advice would be to not to do it. Tie Rails into an existing ad  
> server. You really don’t want to have to write your own ad server if  
> you can avoid it.
> 
> You may find this useful:  
> [http://pjkh.com/articles/2006/12/21/integrating-openads-with-rails](http://pjkh.com/articles/2006/12/21/integrating-openads-with-rails)
> 
> I’m assuming you want to sell your own banners, otherwise integrating  
> Google Adsense or similar is as simple as just dropping in the code.
> 
> -philip

Thank Philip.

I was actually investigating both options, making my own or using  
adsense.Can you please share some information (or links) on how to  
integrate Adsense in my code?

Thanks,  
Youssef

---

<div class="post-metadata">

**Author:** ![semyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce7236/32.png) [@semyou](https://www.ruby-forum.com/u/semyou)\
**Post date:** [March 13, 2009, 7:55pm UTC](https://www.ruby-forum.com/t/managing-ads-banner/162779/4 "2009-03-13T19:55:18Z")

</div>

> > 
> 
> I was actually investigating both options, making my own or using  
> adsense.Can you please share some information (or links) on how to  
> integrate Adsense in my code?

Just drop the code into your views…

If you want to make it a bit more configurable, setup a simple admin  
tool where your ad guy can paste the adsense code into a text\_area and  
then include that. Add some keys so in your view you’d do something  
like:

\<%= AdsenseCode.find\_by\_key(“homepage\_bottom\_right”) %\>

Or similar.

---

<div class="post-metadata">

**Author:** ![semyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce7236/32.png) [@semyou](https://www.ruby-forum.com/u/semyou)\
**Post date:** [April 9, 2009, 11:22pm UTC](https://www.ruby-forum.com/t/managing-ads-banner/162779/5 "2009-04-09T23:22:25Z")

</div>

On way to do this is as mentioned on this blog. I used it and it gave  
some simple steps to getting google ads up and running on my RoR  
application

> **[Google ad Sense code implementation with Ruby on Rails](http://atservice.blogspot.com/2008/07/google-ad-sense-code-implementation.html)**
>
> I needed to integrate Google Adsense with my Ruby On Rails application. It was quiet easy actually but initally it was somewhat time consmin...

On Mar 13, 9:37 pm, Youyou S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
