Help Center Manage Your Account Ad Tag
How can I avoid document.write warning in Chrome?
If you see a warning about document.write in Google Chrome like the one below for the ad server's request, it means you are using an ad tag that uses document.write.A parser-blocking, cross site (i.e. different eTLD+1) script, XXXX, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message.It's a warning and not an error or an ad blocking confirmation. Most likely, the ad will display as normal. If the ad is actually blocked by Chrome for people on very slow Internet connection (eg: 2G, dial-up), it will be confirmed with another console message.
Solution
If you are concerned about this warning and/or have visitors on slow connection, you can use another ad tag option that does not use document.write(). Additionally, if you have multiple ad placements on a page, it is the recommended option because it can be used to combine multiple ad requests into one single call for an even faster ad loading. Learn MoreSample Code
<div id="AdSpeedAd"></div> <script src="//g.adspeed.net/ad.php?do=js&oid=XXXX&zids=YYYY&wd=-1&ht=-1&target=_top" type="text/javascript"></script> <script type="text/javascript"> AdSpeed_div('AdSpeedAd',YYYY); </script>Please change XXXX to your user ID and YYYY to the actual zone ID. If you have multiple zones, please follow these instructions and wizard.
Other Articles in Ad Tag
This section describes the ad tag (serving code) with basic and advanced settings. It includes common ad serving setup instructions and answers frequently asked questions when integrating the ad tag into your site, blog or app.
- Accelerated Mobile Pages Project - AMP Ad Tag
- Can I have ads refresh automatically without a page reload?
- How can I avoid duplicate ads on the same page?
- How can I combine multiple ads in the same placement?
- How can I defer ads until after the page has finished loading?
- How can I display an ad only when it is visible on screen?
- How can I measure ad viewability?
- How can I mix ad dimensions or mix banners with text-link ads?
- How can I put ads into my blog/website?
- How can I serve multiple ad dimensions in the same place?
- How can I serve multiple zones with a single server request?
- How can I support click tracking for external ad servers?
- How can I turn off ad serving error messages?
- How do I add current timestamp into the serving code?
- How do I display mobile ads using Android WebView?
- How do I display mobile ads using Apple iOS WKWebView?
- How do I integrate AdSpeed mobile ad serving API?
- How do I make ads responsive on mobile devices?
- How do I pass custom data and variables into the ad?
- How do I set up advertising on WordPress?
- How do I setup a companion ad in video ad serving?
- How do I setup a passback ad tag?
- How do I switch to secure SSL/https ad serving?
- Should I use protocol-relative URLs in ad tags?
- What are custom ad serving settings and variables?
- What are different formats of serving code?
- What are different types of ad tag?
- What are the effects of ad blocking software?
- What is the pop-up and pop-under ad tag?
- What is the serving code or ad tag?
- What is WMODE for SWF ads? How can I change it?
- Where is the publisher-side file for iframe busting?
- Why doesn't the provided HTML serving code work?
Cannot find an answer for your question? Ask our Customer Care team
Related
- How are technical specifications collected from visitors?
"When a visitor views an ad, our system records certain technical specifications of the ad request such as anonymized IP ..."
- How can I serve multiple zones with a single server request?
"This method is highly recommended if you have 3 or more ad placements on a page. It combines all ad ..."
- How can I defer ads until after the page has finished loading?
"Typically, content is loaded according to the components' order in the HTML source code. If you want visitors to see ..."
- Native Ad Serving
"A native ad is different from a standard advertisement. It blends in with other contents on the page. Example: a ..."
- What is "Object Expected" error in Internet Explorer?
"If an ad shows up properly in Firefox, Safari, Opera but it shows an error "Object Expected" in Internet Explorer, ..."