Async AdSense (make_show_ads_async)
- Category:
- JavaScript
- CoreFilters:
- No
- OptimizeForBandwidth:
- No
- Risk:
- Deprecated
Rewrites synchronous showads.js ad snippets to the asynchronous adsbygoogle.js form so the ads stop blocking rendering. It targets a deprecated AdSense integration; convert the snippets in your templates instead. Live demo: make_show_ads_async.
When to use it
- Not in CoreFilters: it runs only when you enable it by name.
- Risk rating on these docs: Deprecated.
- Targets the deprecated AdSense show_ads.js.
Risks
The
JavaScript filters
page lists no specific risks for this filter.
If a page misbehaves with it, DisableFilters make_show_ads_async turns it off for
the scope you set it in.
Configuration
Enable it in the module configuration, at server, virtual-host or location scope:
Apache
ModPagespeedEnableFilters make_show_ads_asyncnginx
pagespeed EnableFilters make_show_ads_async;IIS (pagespeed.config)
pagespeed EnableFilters make_show_ads_async
Scoping, ForbidFilters and the thresholds filters read:
Choosing filters
.
Live example
Rewrites synchronous Google AdSense tags to the asynchronous format.
Measured on the demo page, original against optimized:
-
HTML size
922 B → 838 B −9%
Frequently asked questions
- What does the make_show_ads_async filter do?
- Rewrites synchronous
showads.jsad snippets to the asynchronousadsbygoogle.jsform so the ads stop blocking rendering. It targets a deprecated AdSense integration; convert the snippets in your templates instead. Live demo: make_show_ads_async. - Is make_show_ads_async enabled by default?
- No.
make_show_ads_asyncis not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name withEnableFilters. - How do I enable make_show_ads_async on Apache and nginx?
- Add
ModPagespeedEnableFilters make_show_ads_asyncon Apache orpagespeed EnableFilters make_show_ads_async;on nginx. On IIS, addpagespeed EnableFilters make_show_ads_asyncto pagespeed.config.
Related filters
- combine_javascript — Combine JavaScript
- defer_javascript — Defer JavaScript
- extend_cache_scripts — Extend cache for scripts
- include_js_source_maps — Include JS source maps
- inline_javascript — Inline JavaScript
- outline_javascript — Outline JavaScript
- rewrite_javascript_external — Minify external JavaScript
- rewrite_javascript_inline — Minify inline JavaScript
This page is drawn from the make_show_ads_async entry on JavaScript filters. Every filter in one table: PageSpeed filters.
Google Analytics, AdSense, Fonts and Hosted Libraries are Google products. We-Amp isn't affiliated with or endorsed by Google.