-
Notifications
You must be signed in to change notification settings - Fork 11
Add signed_in Tracks event whenever we log in socially #156
Conversation
|
| // Disconnect now that we're done with Google. | ||
| GIDSignIn.sharedInstance().disconnect() | ||
|
|
||
| WordPressAuthenticator.track(.signedIn) |
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 we can add a ["source": "google"] here since this is only used by Google as far as I can tell. Thoughts?
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'm happy to do that if that's the case, I just couldn't work out if it was used by not-Google logins. There are no other references to Google in here other than line 180, and the loginSocialSuccess call below doesn't mention Google so I wasn't sure!
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.
Well, I just tried with an Apple account and was finally able to repro wordpress-mobile/WordPress-iOS#12477! 🤦♂
I'd be ok with leaving it generic for now. Currently, it is only google, but hard-coding that is probably dangerous and might be wrong when 12477 is fixed.
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.
👍 Thank you for checking!
ScoutHarris
left a comment
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.
Hey @frosty . I had one question about 2fa tracking, but otherwise looks good.
![]()
aerych
left a comment
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.
Heya @frosty!
Thanks for wrangling this. I had one nitpick, and a thought about another place or two we should be bumping the stat. Pending @ScoutHarris's thoughts on it we might nuke what seems like some dead code either in this or another PR. Back to you sir!
| serviceToken: serviceToken, | ||
| connectParameters: appleConnectParameters, | ||
| success: { | ||
| let source: String = appleConnectParameters != nil ? "apple" : "google" |
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.
We could omit the type specifier here and let it be inferred.
|
|
||
| // Disconnect now that we're done with Google. | ||
| GIDSignIn.sharedInstance().disconnect() | ||
| WordPressAuthenticator.track(.signedIn, properties: ["source": "google"]) |
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.
Wasn't able to reach this code path. I'm guessing its orphaned code now that the social options are available from the prologue vs the LoginEmailViewController. @ScoutHarris, thoughts?
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.
That code is sort of feature flagged via the showNewLoginFlow flag in WordPressAuthenticatorConfiguration. I would suggest removing that flag and associated code in a separate PR. I'm pretty sure there's some storyboard mojo that needs to be removed as well. Yes, it's totally my fault - I haven't cleaned that up post SIWA launch.
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.
After further inspection, I think Woo is still using this code? They still show the Google login option on the email screen. So we can leave this for now I think.
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.
Good catch!
|
Sorry for the delay - @aerych I pushed up some changes to address your feedback. |
aerych
left a comment
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.
Thanks @frosty! Looks good to me.
!
Refs wordpress-mobile/WordPress-iOS#12827. This PR adds
signedIntracks events everywhere we're already posting aloginSocialSuccessevent. You can test this PR with the associated WPiOS PR here: wordpress-mobile/WordPress-iOS#12981I updated 4 locations where I could find usages of
loginSocialSuccesswith no associatedsignedIn. I'm not 100% sure if these are correct, so please let me know what you think! Here's my thoughts on each one:To test