Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.
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 WordPressAuthenticator.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPressAuthenticator"
s.version = "1.10.1"
s.version = "1.10.2"
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."

s.description = <<-DESC
Expand Down
8 changes: 7 additions & 1 deletion WordPressAuthenticator/Signin/AppleAuthenticator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private extension AppleAuthenticator {
return
}

WordPressAuthenticator.track(.createAccountInitiated, properties: ["source": "apple"])
SVProgressHUD.show(withStatus: NSLocalizedString("Continuing with Apple", comment: "Shown while logging in with Apple and the app waits for the site creation process to complete."))

let email = appleCredentials.email ?? ""
Expand Down Expand Up @@ -138,7 +139,12 @@ private extension AppleAuthenticator {

func signupFailed(with error: Error) {
DDLogError("Apple Authenticator: Signup failed. error: \(error.localizedDescription)")
WordPressAuthenticator.track(.signupSocialFailure, properties: ["source": "apple"])

let properties = [ "source": "apple",
"error": error.localizedDescription
]

WordPressAuthenticator.track(.signupSocialFailure, properties: properties)
delegate?.authFailedWithError(message: error.localizedDescription)
}

Expand Down
4 changes: 2 additions & 2 deletions WordPressAuthenticator/Signin/LoginEmailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ extension LoginEmailViewController {

// Disconnect now that we're done with Google.
GIDSignIn.sharedInstance().disconnect()
WordPressAuthenticator.track(.loginSocialSuccess)
WordPressAuthenticator.track(.loginSocialSuccess, properties: ["source": "google"])
}


Expand All @@ -571,7 +571,7 @@ extension LoginEmailViewController {
loginFields.emailAddress = email

performSegue(withIdentifier: .showWPComLogin, sender: self)
WordPressAuthenticator.track(.loginSocialAccountsNeedConnecting)
WordPressAuthenticator.track(.loginSocialAccountsNeedConnecting, properties: ["source": "google"])
configureViewLoading(false)
}

Expand Down
15 changes: 10 additions & 5 deletions WordPressAuthenticator/Signup/SignupGoogleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SignupGoogleViewController: LoginViewController {
override func viewDidLoad() {
super.viewDidLoad()
titleLabel?.text = NSLocalizedString("Waiting for Google to complete…", comment: "Message shown on screen while waiting for Google to finish its signup process.")
WordPressAuthenticator.track(.createAccountInitiated)
WordPressAuthenticator.track(.createAccountInitiated, properties: ["source": "google"])
}

override func viewDidAppear(_ animated: Bool) {
Expand Down Expand Up @@ -133,24 +133,29 @@ private extension SignupGoogleViewController {
// This stat is part of a funnel that provides critical information. Before
// making ANY modification to this stat please refer to: p4qSXL-35X-p2
WordPressAuthenticator.track(.createdAccount, properties: ["source": "google"])
WordPressAuthenticator.track(.signupSocialSuccess)
WordPressAuthenticator.track(.signupSocialSuccess, properties: ["source": "google"])

showSignupEpilogue(for: credentials)
}

/// Social Login Successful: Analytics + Pushing the Login Epilogue.
///
func wasLoggedInInstead(with credentials: AuthenticatorCredentials) {
WordPressAuthenticator.track(.signupSocialToLogin)
WordPressAuthenticator.track(.loginSocialSuccess)
WordPressAuthenticator.track(.signupSocialToLogin, properties: ["source": "google"])
WordPressAuthenticator.track(.loginSocialSuccess, properties: ["source": "google"])

showLoginEpilogue(for: credentials)
}

/// Social Signup Failure: Analytics + UI Updates
///
func socialSignupDidFail(with error: Error) {
WPAnalytics.track(.signupSocialFailure)

let properties = [ "source": "google",
"error": error.localizedDescription
]

WordPressAuthenticator.track(.signupSocialFailure, properties: properties)

if (error as? SignupError) == .unknown {
navigationController?.popViewController(animated: true)
Expand Down