Load tags only once per frame
Stay organized with collections
Save and categorize content based on your preferences.
Overview
This audit ensures that no frames load the same ad tag library script more than
once. Including the same script multiple times is unnecessary and can lead to
decreased page performance.
Recommendations
Remove duplicate ad tag library scripts. In some cases, duplicate scripts can be
unknowingly loaded from two different locations. Examine where each duplicate
script is coming from by reviewing network traffic and grouping requests by
frame.
Identify the source of duplicate scripts
Use the Network tab in Chrome DevTools to determine which frame is loading duplicate scripts.
- Open DevTools by pressing
Control+Shift+J
or Command+Option+J
(Mac).
- Navigate to the Network tab.
- If not already visible, click Filter
to open the filter bar and select
JS.
- Open Network Settings
and select
Group by frame.
- Reload the page to capture network traffic.
![A screenshot of the Network tab in Chrome DevTools](https://developers-dot-devsite-v2-prod.appspot.com/publisher-ads-audits/reference/audits/images/duplicate-scripts-devtools.png)
The following ad tag library scripts are supported:
Library |
Script(s) |
AdSense |
pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
pagead2.googlesyndication.com/pagead/js/show_ads.js
|
Google Publisher Tag |
googletagservices.com/tag/js/gpt.js
securepubads.g.doubleclick.net/tag/js/gpt.js
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-26 UTC."],[[["This audit helps improve website performance by ensuring ad tag library scripts are only loaded once per frame."],["Loading duplicate scripts can slow down page load times and negatively impact user experience."],["Chrome DevTools' Network tab, with grouping by frame enabled, can be used to identify the source of duplicate ad tag scripts."],["AdSense and Google Publisher Tag have specific scripts that should be monitored to ensure single loading instances."]]],[]]