Skip to content

Commit

Permalink
Merge branch 'feature/handle-missing-ga' into feature/fix-google-anal…
Browse files Browse the repository at this point in the history
…ytics
  • Loading branch information
hobbitronics authored Nov 27, 2024
2 parents 31ea007 + 8ac7ae8 commit 5bb3bf0
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
idpInput.value = id;
document.querySelector('form').appendChild(idpInput);
{% if analytics_tracking_id is not empty %}
gtag('event', 'IdP', {
'event_category': 'hub',
'event_label': 'choice',
'value': id
});
{% endif %}
document.querySelector('form').submit();
}
Expand All @@ -33,7 +35,9 @@
});
function clickedAnyway(idpName) {
ga('send', 'event', 'hub', 'choice-disabled', 'IdP', idpName);
{% if analytics_tracking_id is not empty %}
ga('send', 'event', 'hub', 'choice-disabled', 'IdP', idpName);
{% endif %}
}
</script>
</head>
Expand Down
8 changes: 5 additions & 3 deletions modules/material/themes/material/mfa/new-backup-codes.twig
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@
</div>
</div>

<script>
ga('send', 'event', 'error', 'backupcode', 'generation-failed');
</script>
{% if analytics_tracking_id is not empty %}
<script>
ga('send', 'event', 'error', 'backupcode', 'generation-failed');
</script>
{% endif %}
{% endif %}

<div layout-children="row" class="fill-parent">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@
</p>
</div>

<script>
ga('send', 'event', 'error', 'backupcode', '{{ error_message|e('js')|raw }}');
</script>
{% if analytics_tracking_id is not empty %}
<script>
ga('send', 'event', 'error', 'backupcode', '{{ error_message|e('js')|raw }}');
</script>
{% endif %}
{% endif %}

<div class="mdl-card__actions" layout-children="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@
</p>
</div>

<script>
ga('send', 'event', 'error', 'managercode', '{{ error_message|e('js')|raw }}');
</script>
{% if analytics_tracking_id is not empty %}
<script>
ga('send', 'event', 'error', 'managercode', '{{ error_message|e('js')|raw }}');
</script>
{% endif %}
{% endif %}

<div class="mdl-card__actions" layout-children="row">
Expand Down
8 changes: 5 additions & 3 deletions modules/material/themes/material/mfa/prompt-for-mfa-totp.twig
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@
</p>
</div>

<script>
ga('send', 'event', 'error', 'totp', '{{ error_message|e('js')|raw }}');
</script>
{% if analytics_tracking_id is not empty %}
<script>
ga('send', 'event', 'error', 'totp', '{{ error_message|e('js')|raw }}');
</script>
{% endif %}
{% endif %}

<div class="mdl-card__actions" layout-children="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
</p>
</div>

{% if error_message is not empty %}
{% if error_message is not empty and analytics_tracking_id is not empty %}
<script>
ga('send', 'event', 'error', 'webauthn', '{{ error_message|e('js')|raw }}');
</script>
Expand Down
12 changes: 8 additions & 4 deletions modules/material/themes/material/silauth/loginuserpass.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
});
}
ga('send', 'event', 'reCAPTCHA', 'required');
{% if analytics_tracking_id is not empty %}
ga('send', 'event', 'reCAPTCHA', 'required');
{% endif %}
</script>
{% endif %}
</head>
Expand Down Expand Up @@ -100,9 +102,11 @@
</span>
</p>

<script>
ga('send', 'event', 'error', '{{ errorcode|e('js') }}', 'message', '{{ message|e('js') }}');
</script>
{% if analytics_tracking_id is not empty %}
<script>
ga('send', 'event', 'error', '{{ errorcode|e('js') }}', 'message', '{{ message|e('js') }}');
</script>
{% endif %}
{% endif %}

<div class="mdl-card__actions" layout-children="row">
Expand Down

0 comments on commit 5bb3bf0

Please sign in to comment.