diff --git a/CHANGELOG.md b/CHANGELOG.md index f35ad0795..ee05dc1c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ _None._ ### Bug Fixes - Fix unresponsive issue in Onboading Questions screen. [#719] +- Use configuration flag to log custom `step` event for `GetStartedViewController`. [#724] ### Internal Changes diff --git a/Podfile.lock b/Podfile.lock index c1fbc0efa..f26c14ef6 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -22,7 +22,7 @@ PODS: - SVProgressHUD (2.2.5) - SwiftLint (0.49.1) - UIDeviceIdentifier (2.2.0) - - WordPressAuthenticator (5.0.0): + - WordPressAuthenticator (5.1.0-beta.1): - GoogleSignIn (~> 6.0.1) - Gridicons (~> 1.0) - "NSURL+IDN (= 0.4)" @@ -94,7 +94,7 @@ SPEC CHECKSUMS: SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6 SwiftLint: 32ee33ded0636d0905ef6911b2b67bbaeeedafa5 UIDeviceIdentifier: f33af270ba9045ea18b31d9aab88e42a0082ea67 - WordPressAuthenticator: e4fbd4ef3b266d4efad59a28db1dd1c626fc3286 + WordPressAuthenticator: 95f698805ebbbe86c5721ce244e1302ea810326b WordPressKit: 202f529323b079a344f7bc1493b7ebebfd9ed4b5 WordPressShared: 04403b43f821c4ed2b84a2112ef9f64f1e7cdceb WordPressUI: 1cf47a3b78154faf69caa18569ee7ece1e510fa0 diff --git a/WordPressAuthenticator.podspec b/WordPressAuthenticator.podspec index c73469020..9fa87bbaa 100644 --- a/WordPressAuthenticator.podspec +++ b/WordPressAuthenticator.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = 'WordPressAuthenticator' - s.version = '5.0.0' + s.version = '5.1.0-beta.1' s.summary = 'WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps.' s.description = <<-DESC diff --git a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorConfiguration.swift b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorConfiguration.swift index 1b84ed323..f9f357fd7 100644 --- a/WordPressAuthenticator/Authenticator/WordPressAuthenticatorConfiguration.swift +++ b/WordPressAuthenticator/Authenticator/WordPressAuthenticatorConfiguration.swift @@ -136,6 +136,16 @@ public struct WordPressAuthenticatorConfiguration { /// let skipXMLRPCCheckForSiteDiscovery: Bool + /// Used to determine the `step` value for `unified_login_step` analytics event in `GetStartedViewController` + /// + /// - If disabled `start` will be used as `step` value + /// - Disabled by default + /// - If enabled, `enter_email_address` will be used as `step` value + /// - Custom step value is used because `start` is used in other VCs as well, which doesn't allow us to differentiate between screens. + /// - i.e. Some screens have the same `step` and `flow` value. `GetStartedViewController` and `SiteAddressViewController` for example. + /// + let useEnterEmailAddressAsStepValueForGetStartedVC: Bool + /// Designated Initializer /// public init (wpcomClientId: String, @@ -166,7 +176,8 @@ public struct WordPressAuthenticatorConfiguration { enableSocialLogin: Bool = false, emphasizeEmailForWPComPassword: Bool = false, wpcomPasswordInstructions: String? = nil, - skipXMLRPCCheckForSiteDiscovery: Bool = false) { + skipXMLRPCCheckForSiteDiscovery: Bool = false, + useEnterEmailAddressAsStepValueForGetStartedVC: Bool = false) { self.wpcomClientId = wpcomClientId self.wpcomSecret = wpcomSecret @@ -197,5 +208,6 @@ public struct WordPressAuthenticatorConfiguration { self.emphasizeEmailForWPComPassword = emphasizeEmailForWPComPassword self.wpcomPasswordInstructions = wpcomPasswordInstructions self.skipXMLRPCCheckForSiteDiscovery = skipXMLRPCCheckForSiteDiscovery + self.useEnterEmailAddressAsStepValueForGetStartedVC = useEnterEmailAddressAsStepValueForGetStartedVC } } diff --git a/WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift b/WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift index 44219bdbc..638329e87 100644 --- a/WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift +++ b/WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift @@ -464,10 +464,11 @@ private extension GetStartedViewController { tracker.set(flow: .wpCom) } + let stepValue: AuthenticatorAnalyticsTracker.Step = configuration.useEnterEmailAddressAsStepValueForGetStartedVC ? .enterEmailAddress : .start if isMovingToParent { - tracker.track(step: .enterEmailAddress) + tracker.track(step: stepValue) } else { - tracker.set(step: .enterEmailAddress) + tracker.set(step: stepValue) } } }