Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit fcf4d75

Browse files
Merge pull request #724 from wordpress-mobile/feat/723-configuration-flag-for-woo-analytics-step
Use configuration flag to log custom `step` event for `GetStartedViewController`
2 parents d170cbd + bf6681f commit fcf4d75

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ _None._
4343
### Bug Fixes
4444

4545
- Fix unresponsive issue in Onboading Questions screen. [#719]
46+
- Use configuration flag to log custom `step` event for `GetStartedViewController`. [#724]
4647

4748
### Internal Changes
4849

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ PODS:
2222
- SVProgressHUD (2.2.5)
2323
- SwiftLint (0.49.1)
2424
- UIDeviceIdentifier (2.2.0)
25-
- WordPressAuthenticator (5.0.0):
25+
- WordPressAuthenticator (5.1.0-beta.1):
2626
- GoogleSignIn (~> 6.0.1)
2727
- Gridicons (~> 1.0)
2828
- "NSURL+IDN (= 0.4)"
@@ -94,7 +94,7 @@ SPEC CHECKSUMS:
9494
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
9595
SwiftLint: 32ee33ded0636d0905ef6911b2b67bbaeeedafa5
9696
UIDeviceIdentifier: f33af270ba9045ea18b31d9aab88e42a0082ea67
97-
WordPressAuthenticator: e4fbd4ef3b266d4efad59a28db1dd1c626fc3286
97+
WordPressAuthenticator: 95f698805ebbbe86c5721ce244e1302ea810326b
9898
WordPressKit: 202f529323b079a344f7bc1493b7ebebfd9ed4b5
9999
WordPressShared: 04403b43f821c4ed2b84a2112ef9f64f1e7cdceb
100100
WordPressUI: 1cf47a3b78154faf69caa18569ee7ece1e510fa0

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WordPressAuthenticator'
5-
s.version = '5.0.0'
5+
s.version = '5.1.0-beta.1'
66

77
s.summary = 'WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps.'
88
s.description = <<-DESC

WordPressAuthenticator/Authenticator/WordPressAuthenticatorConfiguration.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ public struct WordPressAuthenticatorConfiguration {
136136
///
137137
let skipXMLRPCCheckForSiteDiscovery: Bool
138138

139+
/// Used to determine the `step` value for `unified_login_step` analytics event in `GetStartedViewController`
140+
///
141+
/// - If disabled `start` will be used as `step` value
142+
/// - Disabled by default
143+
/// - If enabled, `enter_email_address` will be used as `step` value
144+
/// - Custom step value is used because `start` is used in other VCs as well, which doesn't allow us to differentiate between screens.
145+
/// - i.e. Some screens have the same `step` and `flow` value. `GetStartedViewController` and `SiteAddressViewController` for example.
146+
///
147+
let useEnterEmailAddressAsStepValueForGetStartedVC: Bool
148+
139149
/// Designated Initializer
140150
///
141151
public init (wpcomClientId: String,
@@ -166,7 +176,8 @@ public struct WordPressAuthenticatorConfiguration {
166176
enableSocialLogin: Bool = false,
167177
emphasizeEmailForWPComPassword: Bool = false,
168178
wpcomPasswordInstructions: String? = nil,
169-
skipXMLRPCCheckForSiteDiscovery: Bool = false) {
179+
skipXMLRPCCheckForSiteDiscovery: Bool = false,
180+
useEnterEmailAddressAsStepValueForGetStartedVC: Bool = false) {
170181

171182
self.wpcomClientId = wpcomClientId
172183
self.wpcomSecret = wpcomSecret
@@ -197,5 +208,6 @@ public struct WordPressAuthenticatorConfiguration {
197208
self.emphasizeEmailForWPComPassword = emphasizeEmailForWPComPassword
198209
self.wpcomPasswordInstructions = wpcomPasswordInstructions
199210
self.skipXMLRPCCheckForSiteDiscovery = skipXMLRPCCheckForSiteDiscovery
211+
self.useEnterEmailAddressAsStepValueForGetStartedVC = useEnterEmailAddressAsStepValueForGetStartedVC
200212
}
201213
}

WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,11 @@ private extension GetStartedViewController {
464464
tracker.set(flow: .wpCom)
465465
}
466466

467+
let stepValue: AuthenticatorAnalyticsTracker.Step = configuration.useEnterEmailAddressAsStepValueForGetStartedVC ? .enterEmailAddress : .start
467468
if isMovingToParent {
468-
tracker.track(step: .enterEmailAddress)
469+
tracker.track(step: stepValue)
469470
} else {
470-
tracker.set(step: .enterEmailAddress)
471+
tracker.set(step: stepValue)
471472
}
472473
}
473474
}

0 commit comments

Comments
 (0)