dom-parser
dom-parser copied to clipboard
Google Analytics - Async Script Attribute doesn't parse correctly.
"version": "0.1.6", "resolved": "https://registry.npmjs.org/dom-parser/-/dom-parser-0.1.6.tgz", "integrity": "sha512-3nVRKbLEwmGfghLoeT1dxlK/0votalnOfasP+8VCHYDfDuCETY4LeMblfOeqww6XZk2ymZ1Uewy/hVad6Dy3yw=="
When including
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX">
The script text gets turned into:
script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX">
I'm using the following code to fetch the html back:
htmlNode.outerHTML
A workaround is to set a value to the attribute
<script async="" src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXX">