Categories

Google Adsense tips and visual overview of ad positions

You are here:
< All Topics

XF 2.1 has a lot of new positions for your ads. Twenty-four to be precisely!
Below you will find visual templates to help you choose the best location for your ads.

You will also find some tips I use to monetize my forum. I would love to start a discussion over here with other forum admins to share your opinions.

Guests vs. Members

Ask yourself: Do you really want to show ads to your precious members?​Your members are the people who keep your forum alive, they are your forum! Do you want to annoy them with ads or should you reward them with an ad free experience?​​I did some a/b tests on my forum for a long time and came to the conclusion that the ad revenue from guests was a lot higher compared to regular members. This made me decide to only show ads to our guests. Members can visit the forum totally ad free.​
Best ad positions

These positions should do very well. Please share your results!​

  • Container content: Above – This position should work for most forums
  • Container content: Below – A nice one that gives some extra revenue
  • Post: Below message container – This one is also interesting but be careful. It can be intrusive. Therefor I suggest to only show an ad after the first and before the last post. The conditional to accomplish this can be found below in this article.
  • After first unread post – RobParker reported very good results with this one. To use this position you will need an addon (Ads Manager 2 lite by Siropu).

Worst ad positions

These ads are a no-go.​

  • Container header – This is really the old school position used for many years. People don’t seem to notice it anymore and it looks ugly. Too far from your content.
  • Sidebar – Although ads in the sidebar look very good from a design point, people will ignore these ads most of the time. For me the extra revenue was not worth it. I like to only show the most effective ads. These sidebar ads are just eating space.
  • In post ads – These ads might give more revenue but they are way to intrusive. Keep in mind you are running a forum which should be nice and readable. These in post ads are a nightmare.

Special Ad Positions

Follow these steps if you want to try one of the special ad position examples:​

  • Goto Admin panel > Setup > Advertising > Add advertisement
  • Select the suggested position as described in the examples below.
  • Put the conditional code in the HTML part
  • Replace ‘### your ad code ###’ with your own Google Adsense (or other) code.

After First and Before Last Post​This conditional will show an ad after the first post and just before the last post on a page. It will not show an ad if the page has less than 4 posts and it will only show the last post ad if there are enough replies.​Position = “Post: Below message container”​Code:

<xf:if is="in_array($post.position % $xf.options.messagesPerPage, [0,$xf.options.messagesPerPage - 2]) AND count($__globals.posts)>4">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>

After First, Middle and Before Last Post​Show an ad after the first post, in the middle and just before the last post on a page. It will not show an ad if the page has less than 4 posts and it will only show the last post ad if there are enough replies.​Position = “Post: Below message container”​Code:

<xf:if is="in_array($post.position % $xf.options.messagesPerPage, [0,($xf.options.messagesPerPage / 2) - 1,$xf.options.messagesPerPage - 2]) AND count($__globals.posts)>4">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>

After First Post​This conditional will show an ad after the first post if there are 2 or more posts on the page.​Position = “Post: Below message container”​Code:

<xf:if is="$post.position % $xf.options.messagesPerPage==0 AND count($__globals.posts)>0">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>

Before Last Post​This conditional will show an ad before the last post.​Position = “Post: Below message container”​Code:

<xf:if is="$post.position % $xf.options.messagesPerPage==$xf.options.messagesPerPage - 2 OR $post.position % $xf.options.messagesPerPage + 2 == count($__globals.posts)">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>

After Last Post​This conditional will show an ad after the last post.​Position = “Post: Below message container”​Code:

<xf:if is="$post.position % $xf.options.messagesPerPage==$xf.options.messagesPerPage - 1 OR $post.position % $xf.options.messagesPerPage + 1 == count($__globals.posts)">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>

Show only if within a node​In this example you will only see ads if you are in node 123. If you want to do the opposite, excluding ads from this node, then just change “==” to “!=”.​Position = Any​Code:

<xf:if is="$__globals.forum.node_id==123">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>

Show only if within these nodes​In this example you will only see ads if you are in node 1,2 and 3. If you want to do the opposite, excluding ads from these nodes, use ‘!in_array…’.​Position = Any​Code:

<xf:if is="in_array($__globals.forum.node_id,['1','2','3'])">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>

Visual Ad Positions

Red boxes: ads for a specific page​Gray boxes = generic ads for all pages​​Forum Overview:

187173

Thread List:

187179

Message List:

187177

What’s New:

187180

Members:

187182

Members Profile:

187184

Help Pages:

187174

Search Page:

187178
Table of Contents