diff --git a/modules/material/themes/material/default/selectidp-links.twig b/modules/material/themes/material/default/selectidp-links.twig index acec01a..0c5cd54 100644 --- a/modules/material/themes/material/default/selectidp-links.twig +++ b/modules/material/themes/material/default/selectidp-links.twig @@ -14,11 +14,13 @@ idpInput.value = id; document.querySelector('form').appendChild(idpInput); - gtag('event', 'IdP', { - 'event_category': 'hub', - 'event_label': 'choice', - 'value': id - }); + {% if analytics_tracking_id is not empty %} + gtag('event', 'IdP', { + 'event_category': 'hub', + 'event_label': 'choice', + 'value': id + }); + {% endif %} document.querySelector('form').submit(); }