1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Google Adsense in phpBB

Discussion in 'Placement / Reviews / Examples' started by blackpudding, Aug 12, 2005.

  1. #1
    A short guide to using Adsense with phpBB forums

    To avoid breaking Googles TOS it's important not to place ads on registration or welcome pages. As there still seem to be a number of people doing this I thought I'd write this guide. The following text outlines how to quickly add adsense banners to the bottom of each page (once you know which files to add code to its easy to play around with placement).

    Tested with phpBB version 2.0.17

    Index page

    Open index_body.tpl

    Find <!-- END switch_user_logged_out -->

    After add the following code:

    Forum pages

    Open viewforum_body.tpl

    Find </form>

    After add the following code:

    Posts

    Open viewtopic_body.tpl

    Find

    <tr align="center">
    <td class="catBottom" colspan="2" height="28"><table cellspacing="0" cellpadding="0" border="0">
    <tr><form method="post" action="{S_POST_DAYS_ACTION}">
    <td align="center"><span class="gensmall">{L_DISPLAY_POSTS}: {S_SELECT_POST_DAYS}&nbsp;{S_SELECT_POST_ORDER}&nbsp;<input type="submit" value="{L_GO}" class="liteoption" name="submit" /></span></td>
    </form></tr>
    </table></td>
    </tr>
    </table>

    After add the following code:


    Adsense after posts

    An alternative way to show ads in threads is to have banners or link units showing after the first post (or every few posts). The easiest way to do this is to install the Inline Banner Ad mod by Brian Rambling.
    http://www.geocator.us/phpBB/viewtopic.php?t=2

    To install the mod use Easymod:
    http://area51.phpbb.com/phpBB/viewforum.php?sid=&f=15

    The great thing about this mod is that you can specify several adverts that will then rotate as pages are viewed / refreshed. You could even choose to have a blank advert every few pages. Additional options include preventing adverts showing to members with high numbers of posts or in certain forums.

    Cheers
    BP
     
    blackpudding, Aug 12, 2005 IP
    dhruvd and jackslounge like this.
  2. lister

    lister Peon

    Messages:
    65
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Thank you for the info
     
    lister, Aug 12, 2005 IP
  3. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #3
    Not to take away from this thread, but if anyone is interested (I would have to dig up the info) there is a less complex way of integrating adsense after the first post on phpbb boards, without having to install a mod.
     
    dcristo, Aug 12, 2005 IP
  4. dcristo

    dcristo Illustrious Member

    Messages:
    19,776
    Likes Received:
    1,199
    Best Answers:
    7
    Trophy Points:
    470
    Articles:
    7
    #4
    dcristo, Aug 12, 2005 IP
  5. aeiouy

    aeiouy Peon

    Messages:
    2,876
    Likes Received:
    275
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Good info. I just added a few more banner ads on my phpbb board in viewforums and viewtopic.. They both show up just under the body of the section, and they only show for guests. I tend to get a lot of browsers who don't register so I decided to throw them a few more ads. :)

    I can share the specific code if anyone is interested.
     
    aeiouy, Aug 12, 2005 IP
  6. blackpudding

    blackpudding Peon

    Messages:
    206
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Its easy to do but it doesn't give you the flexibility of this mod (FWIW adding any code to phpBB could be considered a MOD). I only started using the 'Inline Banner Ad' today instead of the hard-wired code I was already using (I still have normal banners on the index and category pages). Its great for optimising the ads served in threads; you can tweak the layout much quicker than in an offline editor and the ability to exclude groups/forums and rotate ads is invaluable. For anyone considering it here are the admin options (available from the forum admin page).

    Ad Code

    new/edit/delete

    Ad Config

    • Display ads after X post
    • Display ads after every X post
    • Ad style - Normal / special
    • Display ads to All/Registered/Guests
    • Exclude user groups X
    • Exclude forums X
    • Do not display if user has more than X posts

    Cheers
    BP
     
    blackpudding, Aug 12, 2005 IP
  7. Ladan Lashkari

    Ladan Lashkari Active Member

    Messages:
    136
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #7
    Thank you! I'm planning to start a forum using phpBB and this guide is very helpful to me!
     
    Ladan Lashkari, Aug 13, 2005 IP
  8. Dazed_and_confused

    Dazed_and_confused Well-Known Member

    Messages:
    2,071
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    120
    #8
    great thread , thanx :)
     
    Dazed_and_confused, Aug 14, 2005 IP
  9. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I use that Mod and love it...Its one of the more versatile ones and it takes about 30 seconds using EasyMod.

    A lot easier than constantly changing code when experimenting to increase CTR
     
    yfs1, Aug 14, 2005 IP
  10. dvduval

    dvduval Notable Member

    Messages:
    3,369
    Likes Received:
    356
    Best Answers:
    1
    Trophy Points:
    260
    #10
    I've tried these methods, but I still seem to have the best results by putting the ads in overall_header.tpl and overall_footer.tpl. One thing the Inline Banner Ad mod does not do is count backwards. I would much rather place the ads just before the last post.
     
    dvduval, Aug 14, 2005 IP
  11. blackpudding

    blackpudding Peon

    Messages:
    206
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Doesn't this mean the ads show on registration pages (which is against TOS)? Or have you found a way to avoid this while still using the overall_ templates?

    Cheers
    BP
     
    blackpudding, Aug 14, 2005 IP
  12. aeiouy

    aeiouy Peon

    Messages:
    2,876
    Likes Received:
    275
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Yeah you really should not do that. Those will definately put you in violation of the TOS.
     
    aeiouy, Aug 15, 2005 IP
  13. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #13
    http://www.vierstra.com/forum/forum-subject.php/t/2754

     
    minstrel, Aug 15, 2005 IP
    Nokia999 likes this.
  14. blackpudding

    blackpudding Peon

    Messages:
    206
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Thanks for that, its a beautifully simple way of allowing more choice with ad placement :rolleyes:

    Cheers
    BP
     
    blackpudding, Aug 15, 2005 IP
  15. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #15
    Yes. It's not my code (see link in my previous post) but I've been using it on my phpBB forum and it works as advertised.
     
    minstrel, Aug 15, 2005 IP
    aeiouy likes this.
  16. aeiouy

    aeiouy Peon

    Messages:
    2,876
    Likes Received:
    275
    Best Answers:
    0
    Trophy Points:
    0
    #16
    thanks for sharing that minstrel good stuff.
     
    aeiouy, Aug 15, 2005 IP
  17. stolas

    stolas Guest

    Messages:
    30
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #17
    Hi, should you tell adsense that the javascript will be appearing in frames when used with phpBB, or not?

    thanks,

    Ken
     
    stolas, May 1, 2006 IP
  18. NewToAllThis

    NewToAllThis Peon

    Messages:
    741
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #18
    What's a 'Welcome' page? Can you give me an example? I have ads on my index page which is the first page you see when you go to my site. It has the enter site link on it. It also has some content but not much. Would that be considered a Welcome page?
     
    NewToAllThis, May 1, 2006 IP
  19. dadasays

    dadasays Peon

    Messages:
    345
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #19
    You should also work on making your URL information relevant to the topic of discussion, which increases your AdSense ad relevancy, too. In fact, if the URL is strong, you get great ads immediately.
     
    dadasays, May 1, 2006 IP
  20. minstrel

    minstrel Illustrious Member

    Messages:
    15,082
    Likes Received:
    1,243
    Best Answers:
    0
    Trophy Points:
    480
    #20
    Actually, as I understand it the newer AdSense TOS have relaxed that condition - you might want to double check. basically, in the old days the intent was to disallow pages with limited content and probably limited page loads, like the registration page.

    As for the question about frames from stolas, what frames? Unless it's changed markedly from 2.0.18 when I dumped it out of frustration, phpBB doesn't use frames.
     
    minstrel, May 1, 2006 IP