- πΊπΈUnited States jrglasgow Idaho
In looking into this I have removed the old Google Analytics module config portion and added a few check to match with the specified placement
Specifically I have ensures that the script tag doesn't appear for logged in users:
// don't show for logged in users $user = \Drupal::currentUser(); if ($user->isAuthenticated()) { return; }
doesn't appear on password reset/log in/log out pages
// don't show for password reset/login/logout pages $routeMatch = \Drupal::routeMatch(); $route = $routeMatch->getRouteObject(); if (str_starts_with($route->getPath(), '/user/')) { return; }
// doesn't appear on admin page (in case for some reason the previous two tests don't return)
// don't show on admin pages if (\Drupal::service('router.admin_context')->isAdminRoute()) { return; }
-
jrglasgow β
authored 78fe3525 on 8.x-1.x
Issue #3154284 by jrglasgow: Appropriate Placement of the DAP Script Tag
-
jrglasgow β
authored 78fe3525 on 8.x-1.x
- Status changed to Fixed
about 2 years ago 4:39pm 21 February 2023 Automatically closed - issue fixed for 2 weeks with no activity.