- Issue created by @markusa
- πΊπΈUnited States markusa
When I "View Source" of admin vs. front end pages ..
On admin pages:
I see an aggregated js file, then 2 gtm js scripts NOT aggregated and then a couple more aggregated JS files
On the front end, I don't see the un-aggregated gtm scripts in the source.So whatever its doing, when the gtm scripts are NOT in the aggregated scripts, the condition occurs.
If I configure the Google Tag module to exclude /admin/* pages, the condition disappears.
What bothers is why on the admin theme only, is there some 3rd component interacting?
- πΊπΈUnited States kevinquillen
This only appears to work if you Exclude from Admin Pages in the cookie consent settings.
- π¬π§United Kingdom Finn Lewis
We were seeing exactly the same problem.
Enabling: "Exclude admin pages." and "Don't show the banner for site administrators (including UID 1)." seems to resolve it for us.
- πΊπΈUnited States kevinquillen
Yes, this is still a problem. This should be disabled entirely for administrative paths by default.
I ran into this issue myself with the google_tag module.
It seems to be because google_tag's
hook_page_attachments()
implementation is ran after eu_cookie_compliance's.This means that the
disabled_javascripts
check doesn't necessarily work as expected.I notice that we also implement
eu_cookie_compliance_page_attachments_alter()
but don't use that to manipulate the attached library definitions. Is there any particular reason we don't handle the disabling of all assets in the alter hook?It might also be worth implementing a
hook_module_implements_alter()
to ensure that the module acts on the attachments last.Thoughts are more than welcome!
- Merge request !138Issue #3412431: JS Aggregation breaks in 10.1 when disabling other javascripts β (Open) created by codebymikey
- Status changed to Needs review
9 months ago 10:01am 25 March 2024 Updated the logic so that all the duplicated logic is handled by a single function, as well as removed all the disable logic from
hook_page_attachments()
tohook_page_attachments_alter()
so that it can detect dynamic libraries such as thegoogle_tag
one that might be added.Provided a MR which implements the fix in an event subscriber rather than through hooks.
- π¦πΉAustria DrColossos
The comment from #4 worked as expected. For Google Tag Module: It also works if you enable only "Anonymous Users" only tracking
- First commit to issue fork.