Skip to main content

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_async

nginx

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%

See the before and after, with the source diff →

Frequently asked questions

What does the make_show_ads_async filter do?
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.
Is make_show_ads_async enabled by default?
No. make_show_ads_async is not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name with EnableFilters.
How do I enable make_show_ads_async on Apache and nginx?
Add ModPagespeedEnableFilters make_show_ads_async on Apache or pagespeed EnableFilters make_show_ads_async; on nginx. On IIS, add pagespeed EnableFilters make_show_ads_async to pagespeed.config.

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.

Search