Skip to content

CoreBoost v3.3.4

Choose a tag to compare

@github-actions github-actions released this 12 May 03:04
· 6 commits to main since this release

🐛 Fixed - Tag Manager Plain Text Output & GTM Detection Failure

  • document.importNode(template.content, true) replaces template.innerHTML + div.innerHTML round-trip in output_delay_script(). Reading .innerHTML from a <template> element serializes its inert DocumentFragment back to an HTML string. Re-assigning that string to a div.innerHTML re-parses it in the live (scripting-enabled) document, where <noscript> is treated as a raw-text element — its child <iframe> becomes a literal text node that renders as visible markup on the page. document.importNode(template.content, true) clones nodes directly from the inert fragment with no serialization, preserving <noscript> structure correctly. Applied to all three tag blocks (head, body, footer).
  • .textContent replaces .innerHTML for inline script content copies. When recreating <script> elements in the delay injector, content was read/written via .innerHTML. The HTML serializer encodes characters such as & (present in GTM's '&l='+l snippet) to &amp;, corrupting the script and causing Google Tag Assistant to fail to detect the tag. Switching to .textContent bypasses HTML serialization entirely.

Files Modified

  • includes/public/class-tag-manager.phpoutput_delay_script() head, body, and footer tag injection blocks