         self.profile = profile
     }
 
+    func recordSyncedClients(with profile: Profile?) {
+        guard let profile = profile as? BrowserProfile else {
+            return
+        }
+        profile.remoteClientsAndTabs.getClients() >>== { clients in
+            let oldCount = self.prefs?.intForKey(FxaDevicesCountPrefKey) ?? 0
+            if clients.count > oldCount {
+                self.track(event: .fxaSyncedNewDevice)
+            }
+            self.prefs?.setInt(Int32(clients.count), forKey: FxaDevicesCountPrefKey)
+            Leanplum.setUserAttributes([LPAttributeKey.fxaDeviceCount: clients.count])
+        }
+    }
+
     fileprivate func start() {
         guard let settings = getSettings(), supportedLocales.contains(Locale.current.identifier), !Leanplum.hasStarted() else {
             enabled = false

    case signsInFxa = "E_User_Signed_In_To_FxA"
    case useReaderView = "E_User_Used_Reader_View"
    case trackingProtectionSettings = "E_Tracking_Protection_Settings_Changed"
}

struct LPAttributeKey {

private let LPProductionKeyKey = "LeanplumProductionKey"
private let LPDevelopmentKeyKey = "LeanplumDevelopmentKey"
private let AppRequestedUserNotificationsPrefKey = "applicationDidRequestUserNotificationPermissionPrefKey"
private let FxaDevicesCountPrefKey = "FxaDevicesCount"

// FxA Custom Leanplum message template for A/B testing push notifications.
private struct LPMessage {
