Problem/Motivation

The GTM script is conditionally added as a script to the html head.
The GTM noscript is always added to the html body.
As a result, the GTM is loaded for every html request.

Steps to reproduce

Proposed resolution

Use the same visibility conditions for the GTM script and the GTM noscript.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

GTM is not loaded on admin routes.

Data model changes

None.

CommentFileSizeAuthor
#5 cookiebot_gtm.3190071.5.patch642 bytesbatigolix

Comments

idebr created an issue. See original summary.

  • fabianderijk committed dba2d55 on 1.0.x
    Issue #3190071: GTM script and GTM noscript use different visibility...
fabianderijk’s picture

Status: Active » Fixed

This is fixed in the new 1.0.7 release

idebr’s picture

Status: Fixed » Active

Actually no:

cookiebot_gtm_page_attachments_alter has an early return for admin pages

cookiebot_gtm_preprocess_html has no early return for admin pages

batigolix’s picture

Status: Active » Needs review
StatusFileSize
new642 bytes

This patch adds the early check for admin pages to the preprocess_html hook.

idebr’s picture

Status: Needs review » Reviewed & tested by the community

#5 works as expected, thanks!

  • batigolix authored fff54bb7 on 1.0.x
    Issue #3190071 by batigolix, idebr, fabianderijk: GTM script and GTM...
batigolix’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.