@@ -14,6 +14,11 @@ extension Analytics {
1414 // and they need to write a middleware/enrichment now.
1515 // the objc version should accomodate them if it's really needed.
1616
17+ /// Tracks an event performed by a user, including some additional event properties.
18+ /// - Parameters:
19+ /// - name: Name of the action, e.g., 'Purchased a T-Shirt'
20+ /// - properties: Properties specific to the named event. For example, an event with
21+ /// the name 'Purchased a Shirt' might have properties like revenue or size.
1722 public func track< P: Codable > ( name: String , properties: P ? ) {
1823 do {
1924 if let properties = properties {
@@ -29,6 +34,9 @@ extension Analytics {
2934 }
3035 }
3136
37+ /// Tracks an event performed by a user.
38+ /// - Parameters:
39+ /// - name: Name of the action, e.g., 'Purchased a T-Shirt'
3240 public func track( name: String ) {
3341 track ( name: name, properties: nil as TrackEvent ? )
3442 }
@@ -133,15 +141,12 @@ extension Analytics {
133141// MARK: - Untyped Event Signatures
134142
135143extension Analytics {
136- /// Associate a user with their unique ID and record traits about them .
144+ /// Tracks an event performed by a user, including some additional event properties .
137145 /// - Parameters:
138- /// - userId: A database ID for this user. If you don't have a userId
139- /// but want to record traits, just pass traits into the event and they will be associated
140- /// with the anonymousId of that user. In the case when user logs out, make sure to
141- /// call ``reset()`` to clear the user's identity info. For more information on how we
142- /// generate the UUID and Apple's policies on IDs, see
143- /// https://segment.io/libraries/ios#ids
144- /// - properties: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
146+ /// - name: Name of the action, e.g., 'Purchased a T-Shirt'
147+ /// - properties: A dictionary or properties specific to the named event.
148+ /// For example, an event with the name 'Purchased a Shirt' might have properties
149+ /// like revenue or size.
145150 public func track( name: String , properties: [ String : Any ] ? = nil ) {
146151 var props : JSON ? = nil
147152 if let properties = properties {
0 commit comments