## Overview

This audit ensures ad tag library scripts are loaded asynchronously.

By default, JavaScript execution is synchronous. This means that once a script
is encountered, no other content can be loaded until that script has been
downloaded, parsed, and executed. Opting into asynchronous execution prevents
this, allowing the browser to continue processing other resources while the
specified script is loaded in the background. This keeps your page responsive
while scripts are loading and decreses the time necessary to load all critical
components.

## Recommendations

Include the async attribute in the script tag definition. For example:

### AdSense

    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

### AdSense (auto ads)

    <script async data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

### Google Publisher Tag

    <script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script>

## More information

The following ad tag library scripts are supported:

| Ad Tag Library | Script(s) |
|---|---|
| AdSense | `pagead2.googlesyndication.com/pagead/js/adsbygoogle.js` `pagead2.googlesyndication.com/pagead/show_ads.js` |
| Google Publisher Tag | `googletagservices.com/tag/js/gpt.js` `securepubads.g.doubleclick.net/tag/js/gpt.js` |

[Get Started with Google Publisher Tags](https://support.google.com/admanager/answer/1638622)  

[GPT request modes and asynchronous rendering](https://support.google.com/admanager/answer/183282)
[View audit source](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/lighthouse-plugin-publisher-ads/audits/async-ad-tags.js) [Improve this article](https://github.com/googleads/publisher-ads-lighthouse-plugin/tree/HEAD/docs/audits/async-ad-tags.md) [Report an issue](https://github.com/googleads/publisher-ads-lighthouse-plugin/issues/new?labels=documentation&template=documentation-feedback.md&title=Documentation+feedback:+async-ad-tags.md)

<br />