Commit 9bc28195 authored by Igor Biki's avatar Igor Biki Committed by Eric Bremner
Browse files

ISTWCMS-4708 Using service to include/exclude GTM scripts on template level.

parent f7808664
......@@ -32,6 +32,7 @@
<!DOCTYPE html>
<html{{ html_attributes }} class="no-js">
<head>
{% if not uw_admin_page %}
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
......@@ -39,17 +40,20 @@
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-M9XLVF');</script>
<!-- End Google Tag Manager -->
{% endif %}
<head-placeholder token="{{ placeholder_token|raw }}">
<title>{{ head_title|safe_join(' | ') }}</title>
<css-placeholder token="{{ placeholder_token|raw }}">
<js-placeholder token="{{ placeholder_token|raw }}">
</head>
<body{{ attributes.addClass(body_classes) }}>
{% if not uw_admin_page %}
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M9XLVF" height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
{% endif %}
{% include '@components/skiplinks/skiplinks.twig' %}
{{ page_top }}
{{ page }}
......
......@@ -32,6 +32,7 @@ function uw_fdsu_theme_resp_preprocess_html(&$variables) {
// Adding the faculty colour class to the body.
$variables['attributes']['class'][] = theme_get_setting('wcms_colour_scheme', 'uw_fdsu_theme_resp') ? theme_get_setting('wcms_colour_scheme', 'uw_fdsu_theme_resp') : 'org-default';
$variables['uw_admin_page'] = \Drupal::service('uw_cfg_common.uw_analytics')->administrationPage();
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment