Executes where encountered by User
Can be used for adding script elements
Only works while the page is loading; If you call it after the page is done loading, it will overwrite the whole page.
Why It Is Used:
You can overwrite the entire content in a frame/iframe
Way to embed inline content from an external script (to host/domain)
It is the most reliable way for the content (Widget or Ad) to “know” where the HTML author intends for it to be placed.
Scripts can have a negative impact on page performance and modern browsers have taken to blocking scripts. DW can be used to inject and bypass these blocks.
It works everywhere, all the time
Why It Shouldn’t Be Used:
Serializes the rendering engine to pause until external script is loaded. This could take much longer to load than an internal (none-DW) script.
No single script should have the right to control (alter) a page before it’s ready to be viewed
What We Could Do To Improve User Experience with Tag Auditor:
Look for DW in the code
Make a note in the Db (Flag)
When a Tag is seen firing from a Tag Manager AND placed directly on the site
Cross reference the flag
Display a option to show with/without DW Relationship(s)
Like New Tag & Non-Secure Filters
What Authors Can Do To Minimize The Use of document.write
Use safer embedding tools like:
Google Caja: https://developers.google.com/caja/
Ad Safe: http://www.adsafe.org/
Peer-to-peer support and answers on developing CMS templates, modifying privacy scripts or building integrations.
Find answers and ask questions on content management, personalization and targeting.
Find answers and ask questions on WCAG and SEO quality management.
Find answers and ask questions on consent and monitoring solutions.