-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap calls to ga check for analytics_tracking_id #290
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job hunting down all the uses of ga
!
I'm surprised ga is not defined since we should be providing the tracking ID in all IdPs. There may be something else wrong with the ga library. |
I saw that @forevermatt marked GA as deprecated in idp-id-broker. Maybe he or @devon-sil can comment about its use here. |
Good question, maybe the |
In ID Broker, I was deprecating the use of Google Analytics for reporting MFA metrics (server side, from a cron job). This all looks like client-side reporting, but I don't know if we still use that, either. 🤷 |
<script> | ||
ga('send', 'event', 'error', '{{ errorcode|e('js') }}', 'message', '{{ message|e('js') }}'); | ||
</script> | ||
{% if analytics_tracking_id is not empty %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like @forevermatt wanting an abstraction to make the sense of these "is not empty" clearer, even though I know what it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am finding ga
is undefined, but in header.twig gtag is defined and has a slightly different api which looks like:
gtag('event', 'IdP', {
'event_category': 'hub',
'event_label': 'choice',
'value': id
});
@@ -15,11 +15,15 @@ | |||
|
|||
document.querySelector('form').appendChild(idpInput); | |||
|
|||
ga('send', 'event', 'hub', 'choice', 'IdP', id); | |||
{% if analytics_tracking_id is not empty %} | |||
ga('send', 'event', 'hub', 'choice', 'IdP', id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be
gtag('event', 'IdP', {
'event_category': 'hub',
'event_label': 'choice',
'value': id
});
Changed