Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/banned_user_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class BannedUserController < ApplicationController
def show
analytics.track_event(Analytics::BANNED_USER_VISITED)
analytics.banned_user_visited
end
end
2 changes: 1 addition & 1 deletion app/controllers/users/email_confirmations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Users
class EmailConfirmationsController < ApplicationController
def create
result = email_confirmation_token_validator.submit
analytics.track_event(Analytics::ADD_EMAIL_CONFIRMATION, result.to_h)
analytics.add_email_confirmation(**result.to_h)
if result.success?
process_successful_confirmation(email_address)
else
Expand Down
5 changes: 0 additions & 5 deletions app/services/analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ def browser_attributes

# rubocop:disable Layout/LineLength
ACCOUNT_RESET_VISIT = 'Account deletion and reset visited'
ADD_EMAIL = 'Add Email: Email Submitted'
ADD_EMAIL_CONFIRMATION = 'Add Email: Email Confirmation'
ADD_EMAIL_CONFIRMATION_RESEND = 'Add Email: Email Confirmation requested due to invalid token'
ADD_EMAIL_VISIT = 'Add Email: enter email visited'
BANNED_USER_VISITED = 'Banned User visited'
BROKEN_PERSONAL_KEY_REGENERATED = 'Broken Personal Key: Regenerated'
DOC_AUTH = 'Doc Auth' # visited or submitted is appended
DOC_AUTH_ASYNC = 'Doc Auth Async'
Expand Down
15 changes: 15 additions & 0 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ def account_visit
track_event('Account Page Visited')
end

# @identity.idp.event_name Add Email: Email Confirmation
# @param [Boolean] success
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have been excluded?

[warn]: @param tag has unknown parameter name: success 
    in file `app/services/analytics_events.rb' near line 91
Suggested change
# @param [Boolean] success

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#6084 (comment)

I should have added it as a kwarg as well as documenting it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# @param [String] user_id account the email is linked to
# A user has clicked the confirmation link in an email
def add_email_confirmation(user_id:, **extra)
track_event('Add Email: Email Confirmation', user_id: user_id, **extra)
end

# @identity.idp.event_name Authentication Confirmation
# When a user views the "you are already signed in with the following email" screen
def authentication_confirmation
Expand Down Expand Up @@ -111,6 +119,13 @@ def banned_user_redirect
track_event('Banned User redirected')
end

# @identity.idp.event_name Banned User visited
# A user that has been banned from an SP has authenticated, they have visited
# a page showing them that they have been banned
def banned_user_visited
track_event('Banned User visited')
end

# @identity.idp.event_name IdV: phone confirmation otp submitted
# @param [Boolean] success
# @param [Hash] errors
Expand Down