Skip to content

Commit

Permalink
Merge branch 'release/0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mscwilson committed Dec 5, 2023
2 parents 11965f8 + 531cb68 commit b489be0
Show file tree
Hide file tree
Showing 17 changed files with 107 additions and 80 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.5.0

* Add lifecycle autotracking config option (#39)

# 0.4.0

* Add configuration for setting custom HTTP headers for requests to the collector (#34)
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ It is build on top of Snowplow's native [iOS](https://github.com/snowplow/snowpl

## Features

| Feature | Android | iOS | Web |
|---|---|---|---|
| Manual tracking of events: screen views, self-describing, structured, timing, consent granted and withdrawal ||||
| Automatic tracking of views events from Navigator API ||||
| Adding custom context entities to events ||||
| Support for multiple trackers ||||
| Configurable subject properties ||| partly |
| Session context entity added to events ||||
| Geo-location context entity ||||
| Mobile platform context entity ||| |
| Web page context entity | | ||
| Configurable GDPR context entity ||||
| Feature | Android | iOS | Web |
|--------------------------------------------------------------------------------------------------------------|---|---|--------|
| Manual tracking of events: screen views, self-describing, structured, timing, consent granted and withdrawal ||||
| Automatic tracking of views events from Navigator API ||||
| Adding custom context entities to events ||||
| Support for multiple trackers ||||
| Configurable subject properties ||| partly |
| Session context entity added to events ||||
| Geo-location context entity ||||
| Mobile platform context entity ||| |
| Web page context entity | | ||
| Configurable GDPR context entity ||||
| Lifecycle autotracking ||| |

## Quick Start

Expand All @@ -47,7 +48,7 @@ This will add a line with the dependency like this to your `pubspec.yaml`:

```yml
dependencies:
snowplow_tracker: ^0.4.0
snowplow_tracker: ^0.5.0
```

Import the package into your Dart code:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
package com.snowplowanalytics.snowplow_tracker

object TrackerVersion {
val TRACKER_VERSION = "flutter-0.4.0"
val TRACKER_VERSION = "flutter-0.5.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class TrackerConfigurationReader(values: Map<String, Any>) {
val userAnonymisation: Boolean? by valuesDefault
val screenContext: Boolean? by valuesDefault
val applicationContext: Boolean? by valuesDefault
val lifecycleAutotracking: Boolean? by valuesDefault


fun toConfiguration(context: Context): TrackerConfiguration {
Expand All @@ -52,6 +53,7 @@ class TrackerConfigurationReader(values: Map<String, Any>) {
userAnonymisation?.let { trackerConfig.userAnonymisation(it) }
screenContext?.let { trackerConfig.screenContext(it) }
applicationContext?.let { trackerConfig.applicationContext(it) }
lifecycleAutotracking?.let { trackerConfig.lifecycleAutotracking(it) }

return trackerConfig
}
Expand Down
2 changes: 1 addition & 1 deletion doc/01-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This will add a line with the dependency like to your pubspec.yaml:

```yml
dependencies:
snowplow_tracker: ^0.4.0
snowplow_tracker: ^0.5.0
```

Import the package into your Dart code:
Expand Down
31 changes: 17 additions & 14 deletions doc/02-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,26 @@ Setting a custom POST path can be useful in avoiding adblockers; it replaces the

`TrackerConfiguration` provides options to configure properties and features of the tracker. In addition to setting the app identifier and device platform, the configuration enables turning several automatic context entities on and off.

| Attribute | Type | Description | Android | iOS | Web | Default |
|---|---|---|---|---|---|---|
| `appId` | `String?` | Identifier of the app. |||| null on Web, bundle identifier on iOS/Android |
| `devicePlatform` | `DevicePlatform?` | The device platform the tracker runs on. Available options are provided by the `DevicePlatform` enum. |||| "web" on Web, "mob" on iOS/Android |
| `base64Encoding` | `bool?` | Indicates whether payload JSON data should be base64 encoded. |||| true |
| `platformContext` | `bool?` | Indicates whether [platform](http://iglucentral.com/schemas/com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-2) (mobile) context should be attached to tracked events. ||| | true |
| `geoLocationContext` | `bool?` | Indicates whether [geo-location](http://iglucentral.com/schemas/com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-1-0) context should be attached to tracked events. |||| false |
| `sessionContext` | `bool?` | Indicates whether [session](http://iglucentral.com/schemas/com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2) context should be attached to tracked events. |||| true |
| `webPageContext` | `bool?` | Indicates whether context about current [web page](http://iglucentral.com/schemas/com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0) should be attached to tracked events. | | || true |
| `screenContext` | `bool?` | Indicates whether [screen](http://iglucentral.com/schemas/com.snowplowanalytics.mobile/screen/jsonschema/1-0-0) context should be attached to tracked events. ||| | true |
| `applicationContext` | `bool?` | Indicates whether [application](http://iglucentral.com/schemas/com.snowplowanalytics.mobile/application/jsonschema/1-0-0) context should be attached to tracked events. ||| | true |
| `webActivityTracking` | WebActivityTracking?` | Enables activity tracking using page views and pings on the Web. | | || true |
| `userAnonymisation` | `bool?` | Anonymises certain user identifiers. |||| false |
| Attribute | Type | Description | Android | iOS | Web | Default |
|-------------------------|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|---|---|-----------------------------------------------|
| `appId` | `String?` | Identifier of the app. |||| null on Web, bundle identifier on iOS/Android |
| `devicePlatform` | `DevicePlatform?` | The device platform the tracker runs on. Available options are provided by the `DevicePlatform` enum. |||| "web" on Web, "mob" on iOS/Android |
| `base64Encoding` | `bool?` | Indicates whether payload JSON data should be base64 encoded. |||| true |
| `platformContext` | `bool?` | Indicates whether [platform](http://iglucentral.com/schemas/com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-2) (mobile) entity should be attached to tracked events. ||| | true |
| `geoLocationContext` | `bool?` | Indicates whether [geo-location](http://iglucentral.com/schemas/com.snowplowanalytics.snowplow/geolocation_context/jsonschema/1-1-0) entity should be attached to tracked events. |||| false |
| `sessionContext` | `bool?` | Indicates whether [session](http://iglucentral.com/schemas/com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2) entity should be attached to tracked events. |||| true |
| `webPageContext` | `bool?` | Indicates whether context about current [web page](http://iglucentral.com/schemas/com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0) should be attached to tracked events. | | || true |
| `screenContext` | `bool?` | Indicates whether [screen](http://iglucentral.com/schemas/com.snowplowanalytics.mobile/screen/jsonschema/1-0-0) entity should be attached to tracked events. ||| | true |
| `applicationContext` | `bool?` | Indicates whether [application](http://iglucentral.com/schemas/com.snowplowanalytics.mobile/application/jsonschema/1-0-0) entity should be attached to tracked events. ||| | true |
| `webActivityTracking` | `WebActivityTracking?` | Enables activity tracking using page views and pings on the Web. | | || true |
| `userAnonymisation` | `bool?` | Anonymises certain user identifiers. |||| false |
| `lifecycleAutotracking` | `bool?` | Indicates whether the [lifecycle](iglu:com.snowplowanalytics.mobile/application_lifecycle/jsonschema/1-0-0) entity and foreground and background events should be autotracked. ||| | false |

The optional `WebActivityTracking` property configures page tracking on Web. Initializing the configuration will inform `SnowplowObserver` observers (see section on auto-tracking in "Tracking events") to auto track `PageViewEvent` events instead of `ScreenView` events on navigation changes. Further, setting the `minimumVisitLength` and `heartbeatDelay` properties of the `WebActivityTracking` instance will enable activity tracking using 'page ping' events on Web.

Activity tracking monitors whether a user continues to engage with a page over time, and record how he / she digests content on the page over time. That is accomplished using 'page ping' events. If activity tracking is enabled, the web page is monitored to see if a user is engaging with it. (E.g. is the tab in focus, does the mouse move over the page, does the user scroll etc.) If any of these things occur in a set period of time (`minimumVisitLength` seconds from page load and every `heartbeatDelay` seconds after that), a page ping event fires, and records the maximum scroll left / right and up / down in the last ping period. If there is no activity in the page (e.g. because the user is on a different tab in his / her browser), no page ping fires.
Activity tracking monitors whether a user continues to engage with a page over time, and record how they digest content on the page over time. That is accomplished using 'page ping' events. If activity tracking is enabled, the web page is monitored to see if a user is engaging with it. (E.g. is the tab in focus, does the mouse move over the page, does the user scroll etc.) If any of these things occur in a set period of time (`minimumVisitLength` seconds from page load and every `heartbeatDelay` seconds after that), a page ping event fires, and records the maximum scroll left / right and up / down in the last ping period. If there is no activity in the page (e.g. because the user is on a different tab in their browser), no page ping fires.

Lifecycle autotracking is only available on mobile apps (iOS and Android). When configured, a Lifecycle context entity is attached to all events. It records whether the app was visible or not when the event was tracked. In addition, a `Background` event will be tracked when the app is moved to background, and a `Foreground` event when the app moves back to foreground (becomes visible on the screen).

See the separate page for information about anonymous tracking.

Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PODS:
- FMDB/standard (2.7.5)
- integration_test (0.0.1):
- Flutter
- snowplow_tracker (0.4.0):
- snowplow_tracker (0.5.0):
- Flutter
- SnowplowTracker (~> 5.4)
- SnowplowTracker (5.4.0):
Expand Down Expand Up @@ -33,9 +33,9 @@ SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
integration_test: 13825b8a9334a850581300559b8839134b124670
snowplow_tracker: 022a7e65a05a6f6043043d58d8df870b379efe5d
snowplow_tracker: 941f2de51ed3c6964ccab206ac5ba75f326a188a
SnowplowTracker: a7fa5ae461955637f773a51c941635f39a5b0747

PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3

COCOAPODS: 1.12.0
COCOAPODS: 1.12.1
2 changes: 1 addition & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1430;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion example/lib/overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This will add a line with the dependency like this to your `pubspec.yaml`:
```yml
dependencies:
snowplow_tracker: ^0.4.0
snowplow_tracker: ^0.5.0
```
Import the package into your Dart code:
Expand Down
Loading

0 comments on commit b489be0

Please sign in to comment.