When you create an ad, you can select Responsive :)
ah i see it's buried half way down the list of ad units to select ! will try now Just switched to async responsive smart sizing code
yeah the responsive async adsense code https://support.google.com/adsense/answer/3213689 gives me 400 bad request error while trying async non-response with moved adsbygoogle.js works it still shows an error in console (but ads are reproted as served) Code: Error in event handler for (unknown): Blocked a frame with origin "http://googleads.g.doubleclick.net" from accessing a cross-origin frame. Stack trace: Error: Blocked a frame with origin "http://googleads.g.doubleclick.net" from accessing a cross-origin frame. at Error (native) at setupffoverrides (chrome-extension://hnjalnkldgigidggphhmacmimbdlafdo/onloadwff.js:151:86) at checkgenpwfillforms (chrome-extension://hnjalnkldgigidggphhmacmimbdlafdo/onloadwff.js:152:33) at receiveBG (chrome-extension://hnjalnkldgigidggphhmacmimbdlafdo/onloadwff.js:130:210) at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14) at EventImpl.dispatchToListener (extensions::event_bindings:395:22) at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14) at publicClass.(anonymous function) [as dispatchToListener] (extensions::utils:69:26) at EventImpl.dispatch_ (extensions::event_bindings:378:35) at EventImpl.dispatch (extensions::event_bindings:401:17) looks more like a Chrome/Opera warning ? well Adsense do list async responsive as beta though heh maybe related to the technical considerations for responsive ad units ? I know the ad i have doesn't have a width set in parent container
Got async responsive working needed to specifically define width css3 elements Code: <style> .cmres1 { width: 320px; height: 50px; } @media(min-width: 500px) { .cmres1 { width: 468px; height: 60px; } } @media(min-width: 800px) { .cmres1 { width: 728px; height: 90px; } } </style> <!-- cmres1 --> <ins class="adsbygoogle cmres1" style="display:inline-block" data-ad-client="ca-pub-6669518204467592" data-ad-slot="2827005149"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> stripped out adsbygoogle.js and put that in PAGE_CONTAINER template HTML: <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> </head> Also added second responsive async add below content and working as well. Only time you sometimes see missing after first post responsive async ads is when you use jump to last post of a thread in forum thread list view because there's no way to load the first post view port of the window I guess if you jump to last post as opposed to coming in from top of the thread edit: even fixed the missing after post post ad missing too all you need to do is wrap Adsense code around a div tag with specified width element i.e. HTML: <div style="padding-top:10px;width:"85%";"> <style> .cmres1 { width: 320px; height: 50px; } @media(min-width: 500px) { .cmres1 { width: 468px; height: 60px; } } @media(min-width: 800px) { .cmres1 { width: 728px; height: 90px; } } </style> <!-- cmres1 --> <ins class="adsbygoogle cmres1" style="display:inline-block" data-ad-client="ca-pub-6669518204467592" data-ad-slot="2827005149"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div>
I change my width to 100%, because with 85%, it's not centered. OK, I will enable ngx_pagespeed defer js and let see how it goes
i think pagespeed might be causing that as it's correct on admin side edit: doh i see = not : too much time shell scripting fixed at https://community.centminmod.com/threads/ngx_pagespeed-advertising-conflicts.186/page-2#post-1187
I have a problem now , to re-produce. 1st - Please do this on another browser just for testing 2nd - Clear all data/cache 3rd - Open my homepage: https://www.phcorner.net/ On console view, you will notice this error which causing the ads don't load on first time visitor: and related to pagespeed:
But directly visiting this url on the error: https://www.phcorner.net/pagespeed_static/js_defer.eX_CQDtaZA.js Works fine :/
don't want to clear my passwords and cookies heh does this happen on this forum when you clear all that data ?
Couldn't re-produce here You can use this for testing: http://portableapps.com/apps/internet/google_chrome_portable Please.
BTW, here's my config: Code: pagespeed on; # Custom for PHCorner.Net / fix for https only pagespeed LoadFromFile "http://www.phcorner.net" "/home/nginx/domains/phcorner.net/public"; pagespeed LoadFromFile "https://www.phcorner.net" "/home/nginx/domains/phcorner.net/public"; # End pagespeed Disallow "*/admin.php*"; pagespeed Disallow "*/css.php*"; pagespeed Disallow "*/mark-read*"; pagespeed Disallow "*/forums/-/mark-read*"; pagespeed Disallow "*/reply/preview*"; pagespeed Disallow "*/account/alerts-popup*"; pagespeed Disallow "*/conversations/popup*"; pagespeed Disallow "*/conversations/*"; pagespeed Disallow "*/account/alerts/*"; pagespeed Disallow "*/?card*"; pagespeed Disallow "*/misc/quick-navigation-menu*"; pagespeed Disallow "*/misc/update-cache-ttl*"; pagespeed Disallow "*/deferred.php*"; pagespeed Disallow "*/attachments/*"; pagespeed Disallow "*/rgba.php*"; pagespeed Disallow "*/edit-inline*"; pagespeed Disallow "*/save-inline*"; pagespeed Disallow "*/posts/*/save-inline*"; pagespeed Disallow "*/posts/*/edit*"; pagespeed Disallow "*/posts/*/delete*"; pagespeed Disallow "*/posts/*/ip*"; pagespeed Disallow "*/posts/*/report*"; pagespeed Disallow "*/proxy.php*"; pagespeed Disallow "*/js/xenforo/xenforo.js*"; # Custom for PHCorner.Net pagespeed Disallow "*/?&_xfRequestUri*"; pagespeed Disallow "*/alerts-popup*"; pagespeed Disallow "*/js/rellect/AdblockDetector/advertisement.js*"; ###pagespeed Disallow "*/data/bdCache/css/*"; pagespeed Disallow "*adsbygoogle*"; pagespeed Disallow "*google_ad*"; pagespeed Disallow "*show_ad*"; pagespeed Disallow "*/adsbygoogle.js*"; pagespeed MemcachedThreads 1; pagespeed MemcachedServers "localhost:11211"; pagespeed MemcachedTimeoutUs 100000; pagespeed MaxCombinedCssBytes -1; pagespeed PreserveUrlRelativity on; pagespeed ImageResolutionLimitBytes 16777216; pagespeed AvoidRenamingIntrospectiveJavascript on; pagespeed ImageInlineMaxBytes 3072; pagespeed CssImageInlineMaxBytes 0; pagespeed MaxInlinedPreviewImagesIndex -1; pagespeed MinImageSizeLowResolutionBytes 3072; pagespeed MaxCombinedJsBytes 840000; ###pagespeed FetchHttps enable; ## ngx_pagespeed filters settings below ## pagespeed RewriteLevel CoreFilters; pagespeed EnableFilters collapse_whitespace,remove_comments; pagespeed EnableFilters move_css_above_scripts; pagespeed EnableFilters combine_css; pagespeed EnableFilters combine_javascript; pagespeed EnableFilters rewrite_css; pagespeed EnableFilters rewrite_javascript; pagespeed EnableFilters inline_javascript; pagespeed EnableFilters resize_mobile_images; pagespeed EnableFilters rewrite_images; pagespeed EnableFilters convert_png_to_jpeg; pagespeed EnableFilters convert_jpeg_to_webp; pagespeed EnableFilters convert_to_webp_lossless; pagespeed EnableFilters rewrite_css,sprite_images; pagespeed EnableFilters dedup_inlined_images; pagespeed EnableFilters elide_attributes; pagespeed EnableFilters lazyload_images; pagespeed LazyloadImagesAfterOnload off; pagespeed EnableFilters local_storage_cache; pagespeed EnableFilters insert_dns_prefetch; pagespeed EnableFilters remove_quotes; pagespeed EnableFilters trim_urls; pagespeed EnableFilters make_google_analytics_async; pagespeed EnableFilters inline_google_font_css; pagespeed EnableFilters inline_preview_images; pagespeed EnableFilters move_css_to_head; pagespeed EnableFilters prioritize_critical_css; pagespeed EnableFilters defer_javascript; ###pagespeed DisableFilters defer_javascript; ### END
did you edit /usr/local/nginx/conf/pagespeedhandler.conf for the correction for ngx_pagespeed 1.8.31.3 beta from Code: location ~ "^/ngx_pagespeed_static/" { } to Code: location ~ "^/pagespeed_static/" { } then restart nginx
From this link: http://trac.nginx.org/nginx/ticket/190 Looks like incompatibility of ngx_pagespeed and spdy