Skip to content

Commit

Permalink
Merge pull request #1189 from Automattic/lantean/adjusting-copy
Browse files Browse the repository at this point in the history
Magic Links: Adjusting Copy
  • Loading branch information
jleandroperez authored Jul 17, 2024
2 parents 53f72a6 + a40ea75 commit 70a895a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Simplenote/AuthViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ - (void)pressedLogInWithPassword {
}

- (void)pressedLoginWithMagicLink {
[SPTracker trackUserRequestedLoginLink];
[SPTracker trackLoginLinkRequested];

[self clearAuthenticationError];

Expand Down
3 changes: 2 additions & 1 deletion Simplenote/MagicLinkAuthenticator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ private extension MagicLinkAuthenticator {
authenticator.authenticate(withUsername: confirmation.username, token: confirmation.syncToken)

NotificationCenter.default.post(name: .magicLinkAuthDidSucceed, object: nil)
SPTracker.trackUserConfirmedLoginLink()
SPTracker.trackLoginLinkConfirmationSuccess()

} catch {
NSLog("[MagicLinkAuthenticator] Magic Link TokenExchange Error: \(error)")
NotificationCenter.default.post(name: .magicLinkAuthDidFail, object: error)
SPTracker.trackLoginLinkConfirmationFailure()
}
}

Expand Down
2 changes: 1 addition & 1 deletion Simplenote/MagicLinkConfirmationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct MagicLinkConfirmationView: View {
}

private var invalidLinkText: some View {
Text("Link was no longer valid")
Text("Link no longer valid")
.font(.title3)
.foregroundColor(.gray)
}
Expand Down
7 changes: 5 additions & 2 deletions Simplenote/SPTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ NS_ASSUME_NONNULL_BEGIN
+ (void)trackUserSignedUp;
+ (void)trackUserSignedIn;
+ (void)trackUserSignedOut;
+ (void)trackUserRequestedLoginLink;
+ (void)trackUserConfirmedLoginLink;

#pragma mark - Login Links
+ (void)trackLoginLinkRequested;
+ (void)trackLoginLinkConfirmationSuccess;
+ (void)trackLoginLinkConfirmationFailure;

#pragma mark - WP.com Sign In
+ (void)trackWPCCButtonPressed;
Expand Down
16 changes: 12 additions & 4 deletions Simplenote/SPTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,22 @@ + (void)trackUserSignedOut
[self trackAutomatticEventWithName:@"user_signed_out" properties:nil];
}

+ (void)trackUserRequestedLoginLink

#pragma mark - Login Links

+ (void)trackLoginLinkRequested
{
[self trackAutomatticEventWithName:@"login_link_requested" properties:nil];
}

+ (void)trackLoginLinkConfirmationSuccess
{
[self trackAutomatticEventWithName:@"user_requested_login_link" properties:nil];
[self trackAutomatticEventWithName:@"login_link_confirmation_success" properties:nil];
}

+ (void)trackUserConfirmedLoginLink
+ (void)trackLoginLinkConfirmationFailure
{
[self trackAutomatticEventWithName:@"user_confirmed_login_link" properties:nil];
[self trackAutomatticEventWithName:@"login_link_confirmation_failure" properties:nil];
}


Expand Down

0 comments on commit 70a895a

Please sign in to comment.