Google Adsense tips and visual overview of ad positions [Deleted]


I’ve a couple of queries regarding ad placement on Xenforo:
  • How do I put ad in ”Thread View: Below Message List” location below post editor? (currently it’s above).
  • How do I create a simple container in which I can place banner ads (example of what I’m looking for is attached).

The best ad placements WILL vary based on your traffic acquisition...if your primary traffic is from regular users, then ads that "follow" the unread posts are excellent performers. If your traffic is largely from search engines (mine is 82% organic search), then ads at the top of the content will perform well since searches bring the user there.

In my case, a first post ad performs well.

Advertising > Post: Above Message Content

<xf:if is="$post.position % $xf.options.messagesPerPage == 0">
<div style="float: right; padding: 0px 25px 5px 25px;"> 300x250 ad code </div>
Thanks for this great guide.

When using the code for After First, Middle and Before Last Post Do I need to add 3 separate ad units all with this conditional or will just the one ad unit be placed in all 3 locations?
You will need just one ad unit at position "Post: Below message container".
The example code should take care of the rest :)
What about a conditional to not show ads on specific categories and all its forum child?
Although it is not (easily) possible to exclude a complete category, you can excluded nodes.
Maybe this helps:
<xf:if is="!in_array($,['1','2','3'])">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
This will not display ads if in node 1, 2 and 3
I use the following in my DFP/GAM call to target my direct ad banners to specific sections of the forum:

googletag.pubads().setTargeting('VisitorID', '{$xf.visitor.user_id}');
googletag.pubads().setTargeting('Template', '{$template}');
googletag.pubads().setTargeting('ForumID', '{$forum.node_id}');
googletag.pubads().setTargeting('ParentID', '{$forum.Node.parent_node_id}');
If anyone is curious, my earnings had drooped lately and this thread really brought things back. Thank you!
Red is essentially eligible page views, yellow is ads displayed and blue is earnings.
  • Wow
Reactions: rdn
The suggested conditional inside thread/post ads doesn't work for me because I use this addon: (i guess ruins post position)

This is the only conditional that works for me:
<xf:if is="{$__globals.thread} AND {$} AND {$__globals.thread.first_post_id} == {$}">
For 1st post only, not sure how to modify it to target other post ID/#.

Any advice?
Top Bottom