Responsive AdSense

Responsive AdSense

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.
 
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:

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

</xen:if>
</xen:if>

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:

Code:
<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
</xen:if>
</xen:if>
 
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.
 
Hi, quick question, the overview here says this:

google_ad_slot = "123456890";

But my adsense code says:

data-ad-slot="123456789";

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

Thanks.
 
Use whatever code Google provide - it changes over time so the examples in the guide are likely outdated now.
 
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 :
Code:
<xen:if is="{$message.usergroup} == 1">
    Ad code here
</xen:if>

What i understand this far is :
  • The template which must be edited is : "message".
  • I only can read $message.user_id
 
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.
 
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?
 
@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.

Ad_Header
adheader.webp

EXTRA.css
extra.webp

Desktop Preview
DESKTOP.webp
Mobile
16117834_10158171068705002_1201169131_n.webp
 
Replace all your ads with Google Responsive ads and you won't have to go through trying to get the CSS right. Google does all the work for you.
 
Top Bottom