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 More

Sample 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.

Cannot find an answer for your question? Ask our Customer Care team

Related