-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: DAH-3043 Analytics for Application Flow #2448
Conversation
975d2ab
to
e868bee
Compare
e868bee
to
6ec2a35
Compare
@@ -1,5 +1,5 @@ | |||
.back-link-container.small-only-text-center ng-if="rememberedShortFormState" | |||
a.back-link ui-sref="{{rememberedShortFormState}}" | |||
a.back-link(ui-sref="{{rememberedShortFormState}}" ng-click="logBackLinkClick()") |
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.
thought: I wonder about how useful this will be.
- create-account: the button is clicked when the applicant starts creating an account, but changes their mind and goes back to the application
- sign-in: this now defaults to the React version of the page
- forgot-password: the button is clicked when the button to reset their password, then click back to the application
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.
@jimlin-sfgov Tenley can distinguish on her end where the user is coming from because the data sent to google analytics includes the origin url cc: @chadbrokaw
@@ -136,6 +136,9 @@ | |||
onConfirm: -> | |||
# fires only if user clicks 'ok' to leave page | |||
# reloads this stateChangeStart method with skipConfirm true | |||
AnalyticsService.trackApplicationAbandon(ShortFormApplicationService.listing.listingID, null, "Leaving for " + toState.name) | |||
$window.removeEventListener('unload', $rootScope.onUnload) | |||
|
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.
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.
Yes! The browser dialog situation is covered by the onUnload handler that I added
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.
Agree w/ Jim's comments - but also not seeing tags being fired on the pr app. Should I test locally only?
@@ -620,6 +620,7 @@ | |||
|
|||
if ShortFormApplicationService.application.status == 'Submitted' | |||
# send them to their review page if the application is already submitted | |||
AnalyticsService.trackApplicationAbandon(listing.Id, AccountService.loggedInUser?.id || null, "Application already submitted") |
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.
Question: Why would there ever not be an id here?
@@ -6,27 +6,38 @@ AnalyticsService = ($state) -> | |||
Service = {} | |||
Service.timer = {} | |||
|
|||
Service.resetProperties = { |
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.
Should this object have any values?
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.
Not currently, there may be some values we want to nullify in the future though so I left the empty object in there
doubleSubmit = !! $scope.appIsSubmitted($scope.application) | ||
if $window.ACCOUNT_INFORMATION_PAGES_REACT is "true" | ||
currentUrl = window.location.origin | ||
newUrl = "#{currentUrl}/my-applications?" | ||
if previousApp.id | ||
AnalyticsService.trackApplicationAbandon($scope.listing.Id, AccountService.loggedInUser?.id || null, 'Already Submitted') |
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.
Same here, why would the id ever be null?
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.
It shouldn't ever be null, I added the check just to be 100% sure
newUrl += "alreadySubmittedId=#{previousApp.id}" | ||
if doubleSubmit | ||
newUrl += "&" | ||
if doubleSubmit | ||
# As we rebuilt the My Applications page in React we were not able to figure out a way to trigger the Double Submit Modal. | ||
# We are leaving the code here both to document past behavior and to protect the application in case somehow the modal is triggered | ||
AnalyticsService.trackApplicationAbandon($scope.listing.Id, AccountService.loggedInUser?.id || null, 'Double Submitted') |
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.
This has not been triggered right? Only there to cover our bases?
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.
Yes! I honestly added this for me to see if it is ever being triggered, based on my exploration of the code this situation should never occur
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.
This looks great! I'm comfortable moving forward with it and updating as needed. It seems to me that it covers all the situations you laid out.
My main question is about allowing a null id - in the cases I pointed out, it seems like not having a user id would indicate a bug.
ed1d817
to
39af3e7
Compare
Description
This PR adds in logging for the application flow including application start, application abandon, and application complete.
Jira ticket
DAH-3043
Checklist before requesting review
Version Control
angular
if it contains updates to Angular codetype: TICKET-NUMBER Description
format, e.g.feat: DAH-123 New Feature
Code quality
Review instructions
Request review
needs review
labelHousing Eng
group to automatically assign reviewers, and/or assign specific engineers