Responsive AdSense

Responsive AdSense


Active member
I've just checked with Google Webmaster Tools and in Search Appearance > Structured Data it is showing me a lot of threads, each with the same error:

Missing: name (fn)

Upon investigation, this appears to be from the Google Adsense advertisement in the first post of each thread.

Have you resolved this error? "Missing: name (fn)"

Google is reporting 17,994 pages with that error on my forum.


Well-known member
Have you resolved this error? "Missing: name (fn)"

Google is reporting 17,994 pages with that error on my forum.
I believe I posted the solution in the post you quoted. I can't remember any more though as I no longer use the "guest" advertisement post.
Has anyone got this working with the asynchronous code as opposed to the synchronous code shown in the example?

Are there actually any benefits using one over the other?
Hi with this code:

<xen:if is="!{$visitor.is_admin} OR {$visitor.is_moderator}">
<xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook', 'register_twitter', 'register_google', 'login', 'error_with_login', 'contact', 'thread_create'))">

adsense code

The adsense still appears for admin and moderators user.

Any ideas?

Thanks fr you support.
Trying to implement this and have the same behavior. Is there a proper way to nest this so it works? Here is the code I'm using:

<xen:if is="{xen:helper ismemberof, $visitor, 1, 2, 4}">
<xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook', 'register_twitter', 'register_google', 'login', 'login_two_step', 'error_with_login', 'contact'))">
Adsense Code


Formerly CyclingTribe
Are there actually any benefits using one over the other?
My understanding is that the asynchronous code allows your page content to continue loading whilst the ad content loads in the backgroud (and displays once completed). It helps to avoid the situation where your pages "stall" or only partly load because they are stopped waiting for ad content to be served.


Active member
Hi, quick question, the overview here says this:

google_ad_slot = "123456890";

But my adsense code says:


Should I change all the 'google' part of the code to 'data'?



Active member
What i am trying to do is :

I want to include ad code within all message body, which is posted by all members, in certain usergroup.
How can i achieve that?

I was thinking something like :
<xen:if is="{$message.usergroup} == 1">
    Ad code here
What i understand this far is :
  • The template which must be edited is : "message".
  • I only can read $message.user_id


XenForo moderator
Staff member
I don't use Amazon CPS so have no familiarity with it.

You will need to contact the ad provider for specific implementation - this guide is specifically for AdSense only as far as the ad code is concerned.


Active member
as it is JavaScript based, the advertisements will not change on the fly as the browser window is resized. Instead, a page refresh is required.
Does this resource useful with Google responsive ad-unit? I mean, is there any added benefit?


Well-known member
@Brogan I've got a warning "Large ads above the fold on mobile", I have to fix this before deadline. My current ad units are responsive and usually display 320x100 ad but it's possible that some time it display 300x250 ad, which pushes content down. Seems like Google just don't want mobile users to scroll to be be able to read the mobile content. So I think, to be safe, I should not display top ad unit on small screen mobile above the fold, but at the same place I want the same ad unit display on normal/wide screens. I need a complete example code for Asynchronous ad code, please.
Last edited:
Hi @Brogan, been working on this tonight. I now have a 600x90 Custom unit running on Desktop, but it seems to be trying to run the same on mobile, despite me adding the following to my extra.css and ad.header, causing the following break. I'm sure I'm missing something small- help as always gratefully appreciated.



Desktop Preview