Releases: snowplow/snowplow-ios-tracker
Version 5.0.1
This patch release fixes a bug introduced in the 5.0 release of the tracker that resulted in validation errors of tracked events when user anonymisation was enabled. This was caused by a missing property in the client session context entity.
Bug fixes
- Fix validation errors due to session schema tracked without required previousSessionId property when anonymous tracking (#767)
Version 5.1.0-beta.1
This pre-release ads an integration with the FocalMeter system by Kantar that measures audience of content through a router meter.
Enhancements
- Add configuration to send requests with user ID to a Focal Meter endpoint (#745)
Version 5.0.0
The major enhancement is the modernization of the trackers – we migrated the iOS tracker code base from Objective-C to Swift and Android from Java to Kotlin. This enables the tracker to provide APIs that work better with modern Swift and Kotlin apps. The modern programming languages also enable a safer implementation of core features of the tracker. Finally, we could simplify the tracker code and build system, making it easier to contribute to and maintain the trackers moving forward.
Version 5 also brings the ability to implement custom tracker plugins to intercept tracked events. Plugins provide callbacks that can enrich events with additional entities and inspect tracked events. You can read more about mobile tracker plugins in the documentation.
We also improved support for tracking screen views in modern UI frameworks – SwiftUI and JetPack Compose. Screen views in SwiftUI apps can now be tracked using the .snowplowScreen(name: "ScreenName")
modifier on the View component. For views annotated with the modifier, screen view events will be tracked as the views appear in the SwiftUI lifecycle. For JetPack Compose, we prepared a demo app that showcases best practices for tracking screen views in Compose apps. Read more about the support in the documentation.
The tracker is now easier to use in Swift as the API doesn't enforce numbers and dictionaries to be passed as NSObject
. The release also fixes a problem that the IDFA identifier could not be tracked on apps installing the library through Swift Package Manager. Support for Carthage has been removed from the iOS tracker and the project now fully adopts Swift Package Manager as the build system. On the Android tracker, Gradle has been upgraded to 7.6.
Please refer to the migration guide to learn about the breaking changes and how to resolve them.
Enhancements
- Migrate to Swift (#732)
- Add ability to provide custom tracker plugins to inspect and enrich tracked events (#750)
- Add screen view tracking for SwiftUI (#705)
- Use Swift DSL for building configurations and add builder functions for configurations and events (#755)
- Refactor event interface and rename contexts to entities (#757)
- Refactor APIs to replace usage of NSObject in dictionaries with the Any type (#748)
- Add a closure to tracker configuration that enables retrieving IDFA value and replaces the use of SNOWPLOW_IDFA_ENABLED macro (#678)
Under the hood
- Drop Carthage and build using Swift Package Manager (#735)
- Remove requirement for all configurations to be serializable (#753)
- Rename the repository from snowplow-objc-tracker to snowplow-ios-tracker
- Update year in copyright headers and remove authors from headers in source files (#759)
- Add tests using Micro for payload validation (#736)
- Add redirect from root documentation page
- Update API comments for Swift-DocC and add missing comments (#740)
- Add API docs using Swift-DocC (#739)
Version 5.0.0-beta.1
This is the third pre-release of the upcoming version 5 of the iOS tracker, written in Swift. This beta release brings new features as well as refactoring the tracker internals.
The headline feature is the ability to provide custom tracker plugins to intercept tracked events. Plugins provide callbacks that can enrich events with additional entities and inspect tracked events. See this snippet for a glimpse of a tracker plugin:
// identifier needs to uniquely identify the plugin
let plugin = PluginConfiguration(identifier: "myPlugin")
// entities closure can return context entities to enrich events
// the list of schemas to call the closure for is optional (it will be called for all events if null)
plugin.entities(schemas: ["iglu:..."]) { event in
return [
SelfDescribingJson(schema: "iglu:xx", andData: ["yy": true])
]
}
// after track callback called on a background thread to inspect final tracked events
// one can also supply a list of schemas to call the closure only for specific events
plugin.afterTrack { event in
print("Tracked event with \(event.entities.count) entities")
}
// the plugin is supplied to the tracker as a configuration
let tracker = Snowplow.createTracker(namespace: "ns",
network: networkConfig,
configurations: [plugin])
There is also an option to use Swift DSL to configure a tracker instance making the configuration code easier to read:
Snowplow.createTracker(namespace: "appTracker", endpoint: COLLECTOR_URL) {
TrackerConfiguration()
.base64Encoding(false)
.sessionContext(true)
SessionConfiguration(
foregroundTimeout: Measurement(value: 30, unit: .minutes),
backgroundTimeout: Measurement(value: 30, unit: .minutes)
)
}
Finally, we have refactored the tracker internals to simplify the code and improve it's maintainability. Apart from improvements under the hood, the tracker is now easier to use in Swift as the API doesn't enforce numbers and dictionaries to be passed as NSObject
.
Enhancements
- Add ability to provide custom tracker plugins to inspect and enrich tracked events (#750)
- Use Swift DSL for building configurations and add builder functions for configurations and events (#755)
Under the hood
- Remove requirement for all configurations to be serializable (#753)
- Refactor event interface and rename contexts to entities (#757)
- Refactor APIs to replace usage of NSObject in dictionaries with the Any type (#748)
- Update year in copyright headers and remove authors from headers in source files (#759)
Version 5.0.0-alpha.2
This is the second pre-release of the upcoming version 5 of the iOS tracker written in Swift. This pre-release brings several significant features and changes to the tracker: (1) screen view tracking in SwiftUI, (2) move to Swift Package Manager as the build system and removal of Carthage, and (3) a new way to track the IDFA identifier for advertisers.
Screen views in SwiftUI apps can now be tracked using the .snowplowScreen(name: "ScreenName")
modifier on the View
component. For views annotated with the modifier, screen view events will be tracked as the views appear in the SwiftUI lifecycle.
Support for Carthage has been removed from the project. Fully adopting the Swift Package Manager enables us to simplify the build system and avoid workarounds that were previously needed to support Carthage. We believe this will make it easier to maintain the tracker while covering all use cases with Swift Package Manager and CocoaPods. If you have feedback about this change, we'd be happy to hear from you on Discourse!
Finally, the release fixes a problem that the IDFA identifier could not be tracked on apps installing the library through Swift Package Manager. It introduces a new API to set a closure in TrackerConfiguration.advertisingIdentifierRetriever
that retrieves and returns the identifier.
Enhancements
- Add screen view tracking for SwiftUI (#705)
- Drop Carthage and build using Swift Package Manager (#735)
- Add a closure to tracker configuration that enables retrieving IDFA value and replaces the use of SNOWPLOW_IDFA_ENABLED macro (#678)
- Add API docs using Swift-DocC (#739)
Under the hood
Version 5.0.0-alpha.1
We are excited to announce our plans for the version 5 of our iOS Tracker. In addition, we are releasing the first alpha pre-release of the v5 tracker.
The major enhancement is the modernization of the trackers – we will migrate the iOS tracker from Objective-C to Swift. This opens up a range of exciting new possibilities for the tracker. It will provide APIs that work better with modern Swift and Kotlin apps. We will also be able to bring new features to the trackers such as autotracking for SwiftUI. The modern programming language will enable a safer implementation of core features of the tracker. Finally, it will enable us to simplify the tracker code and build system, making it easier to contribute to and maintain the trackers moving forward.
Version 5 will also bring other new features to the trackers that we are already excited about. We will announce these as we progress on them and publish next pre-releases. Stay tuned!
If you are interested in testing the experimental alpha 1 release, we would appreciate your feedback!
CHANGELOG
- Migrate to Swift (#732)
Version 4.1.0
This release improves the anonymous tracking functionality by anonymising additional properties in Subject and Session. In Subject, the manually set userId
, domainUserId
, networkUserId
, and ipAddress
are now anonymised. In Session, previousSessionId
is anonymised to prevent stitching independent anonymous sessions.
Now the tracker also sets the page_referrer
and page_url
atomic event properties for Screen View events. This improves compatibility with the Referer parser enrichment.
Enhancements
- Anonymise previous session ID and user identifiers in subject when user anonymisation is enabled (#720)
- Add DeepLink entity referrer and url to atomic properties in ScreenView events (#718)
- Fix compiler warning in SPEmitterControllerImpl to synthesize customRetryForStatusCodes (#722)
- Log an error when recreating tracker after being removed (#716)
Under the hood
- Fix links in README (#724)
Version 4.0.1
This patch release fixes a bug raised and solved by Wipoo Shinsirikul (@mylifeasdog). When tracker is paused from tracking events the track
method doesn't track events, hence it returns nil rather than the event ID of the tracked events. Unfortunately, on Swift the track
method doesn't return an optional and that was a cause of crashes.
This patch release fixes the track
method for Swift avoiding the crashes.
CHANGELOG
Bug fixes:
- Add nullable modifier to prevent crashes in track function (#713)
Version 4.0.0
These releases bring two exciting new features to the trackers: support for hybrid apps, and anonymous tracking.
Support for hybrid apps enables tracking Snowplow events in Web views. The iOS and Android trackers communicate with the WebView tracker that can be installed in Web apps to track events. This enables events to share the same session and context entities as events tracked using the native mobile trackers!
Anonymous tracking is a tracker feature that enables anonymising various user and session identifiers to support user privacy in case consent for tracking the identifiers is not given. Similar to the JavaScript tracker, the mobile trackers let you configure user anonymisation (using the userAnonymisation
flag in TrackerConfiguration
) to anonymise user identifiers in session and platform context and server anonymisation (using the serverAnonymisation
flag in EmitterConfiguration
) to anonymise the network_userid
and user_ipaddress
properties assigned by the Collector.
Other changes in the trackers include improvements in remote configuration that now supports switching between multiple remote configuration endpoints and gives feedback of where the configuration was retrieved from (from cache, default values or fetched over network). Additionally, the tracker.track(event)
function now returns the event ID. Thanks to an external contribution from @onato, the iOS tracker can now be utilized in share extensions.
We are also excited to announce major improvements to the documentation that now gives more guidance on how to make use of all the tracker features!
CHANGELOG
Bug fixes:
- Do not resume remote configuration from cache in case it has different endpoint (#688)
- Fix too many events tracked by screen view autotracking (#689)
- Ignore trailing slashes in the network configuration endpoint (#695)
Enhancements:
- Add interface to subscribe for events tracked in Web views (#691)
- Add anonymous tracking features (#702)
- Return tracked event ID from the track method (#710)
- Extend the onSuccess callback when setting up remote configuration to pass configuration state (#694)
- Add support for tracking events in a Share Extension (#700) (thanks to @onato)
Under the hood:
Version 3.2.0
The tracker now makes use of the client_session
schema version 1-0-2, which adds two new properties to the session context entity – eventIndex
(index of the event in the session) and firstEventTimestamp
(timestamp of the first event in the session). The event index property is useful for ordering events as they were tracked.
The release also changes the behaviour for 5 HTTP status codes (400, 401, 403, 410, and 422) that, when received in response from the Collector, will now cause the tracker not to retry sending events (i.e., drop the events). Requests with all other 3xx, 4xx, and 5xx status codes are retried. The set of status codes for which events should be retried or not is customizable in EmitterConfiguration
. The following shows the configuration in the iOS tracker:
var customRetryRules = [Int:Bool]()
customRetryRules[403] = true // retry for the 403 HTTP status code
let emitterConfig = EmitterConfiguration()
.customRetryForStatusCodes(customRetryRules)
CHANGELOG
Features: