I have a plain HTML file and am testing if the Google Ads and Analytics scripts work before adding it on other pages. A colleague who has an AdSense account sent me the script codes to add in the HTML head. After testing, the page shows nothing in any browser.
I had already disabled ad blocking, used incognito mode, and even copied the sample code from https://support.google.com/adsense/answer/181950?hl=en. Why don't the ads appear on the test page and how can I make them appear? The code is below (replaced sensitive numbers with XXXXX):
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>Test page</title>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-XXXXXXXXXXXXXXXXX",
enable_page_level_ads: true
});
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-X"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXXXXX-X');
</script>
</head>
<body>
</body>
</html>
I also get the error:
GET https://www.google-analytics.com/analytics.js net::ERR_QUIC_PROTOCOL_ERROR