Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mscwilson committed Oct 10, 2022
2 parents c0fe3e3 + f69ced8 commit da0e152
Show file tree
Hide file tree
Showing 39 changed files with 226 additions and 296 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
flutter: ['2.8.0']
flutter: ['3.0.0']
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
Expand All @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.8.0'
flutter-version: '3.0.0'
channel: 'stable'
- run: flutter pub get
- run: flutter analyze
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
# -- Integration tests --
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.8.0'
flutter-version: '3.0.0'
channel: 'stable'

- name: Run Flutter Driver tests
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:

- uses: subosito/flutter-action@v1
with:
flutter-version: '2.8.0'
flutter-version: '3.0.0'
channel: 'stable'

- run: "flutter clean"
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
# -- Integration tests --
- uses: subosito/flutter-action@v1
with:
flutter-version: '2.8.0'
flutter-version: '3.0.0'
channel: 'stable'

- run: chromedriver --port=4444 &
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
flutter: ['2.8.0']
flutter: ['3.0.0']
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v1
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.2.0
* Configure custom POST path (#15)
* Upgrade underlying mobile native trackers to version 4 (#17)
* Fix schema link in documentation for ScreenView (#12)
* Remove loading custom JavaScript for session context and reading cookies (#13)
* Upgrade min Flutter, Dart and Android SDK versions and upgrade dependencies (#19) - thanks @koga for the Android work!

# 0.1.0

* Add route observer for auto tracking screen or page view events on navigation (#9)
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The Snowplow Flutter Tracker is maintained by the Engineering team at Snowplow A

We are extremely grateful for all contributions we receive, whether that is reporting an issue or a change to the code which can be made in the form of a pull request.

For support requests, please use our community support Discourse forum: https://discourse.snowplowanalytics.com/.
For support requests, please use our community support Discourse forum: https://discourse.snowplow.io/.

## Setting up an Environment

Expand All @@ -16,7 +16,7 @@ You should ensure you are comfortable building and testing the existing release

### Creating an issue

The project contains an issue template which should help guiding you through the process. However, please keep in mind that support requests should go to our Discourse forum: https://discourse.snowplowanalytics.com/ and not GitHub issues.
The project contains an issue template which should help guiding you through the process. However, please keep in mind that support requests should go to our Discourse forum: https://discourse.snowplow.io/ and not GitHub issues.

It's also a good idea to log an issue before starting to work on a pull request to discuss it with the maintainers. A pull request is just one solution to a problem and it is often a good idea to talk about the problem with the maintainers first.

Expand Down Expand Up @@ -75,6 +75,6 @@ The @snowplowcla bot will guide you through the process.

### Community support requests

Please do not log an issue if you are asking for support, all of our community support requests go through our Discourse forum: https://discourse.snowplowanalytics.com/.
Please do not log an issue if you are asking for support, all of our community support requests go through our Discourse forum: https://discourse.snowplow.io/.

Posting your problem there ensures more people will see it and you should get support faster than creating a new issue on GitHub. Please do create a new issue on GitHub if you think you've found a bug though!
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This will add a line with the dependency like this to your `pubspec.yaml`:

```yml
dependencies:
snowplow_tracker: ^0.1.0
snowplow_tracker: ^0.2.0
```

Import the package into your Dart code:
Expand All @@ -58,9 +58,9 @@ import 'package:snowplow_tracker/snowplow_tracker.dart'

#### Installation on Web

If using the tracker within a Flutter app for Web, you will also need to import the Snowplow JavaScript Tracker in your `index.html` file. Please load the JS tracker with the Snowplow tag as [described in the official documentation](https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v3/tracker-setup/loading/). Do not change the global function name `snowplow` that is used to access the tracker – the Flutter APIs assume that it remains the default as shown in documentation.
If using the tracker within a Flutter app for Web, you will also need to import the Snowplow JavaScript Tracker in your `index.html` file. Please load the JS tracker with the Snowplow tag as [described in the official documentation](https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v3/tracker-setup/loading/). Do not change the global function name `snowplow` that is used to access the tracker – the Flutter APIs assume that it remains the default as shown in documentation.

Make sure to use JavaScript tracker version `3.2` or newer. You may also refer to the [example project](https://github.com/snowplow-incubator/snowplow-flutter-tracker/tree/main/example) in the Flutter tracker repository to see this in action.
Make sure to use JavaScript tracker version `3.5` or newer. You may also refer to the [example project](https://github.com/snowplow-incubator/snowplow-flutter-tracker/tree/main/example) in the Flutter tracker repository to see this in action.

### Using the Tracker

Expand Down Expand Up @@ -223,8 +223,8 @@ limitations under the License.

[website]: https://snowplowanalytics.com
[snowplow]: https://github.com/snowplow/snowplow
[docs]: https://docs.snowplowanalytics.com/
[flutter-docs]: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/flutter-tracker/
[docs]: https://docs.snowplow.io/
[flutter-docs]: https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/flutter-tracker/

[gh-actions]: https://github.com/snowplow-incubator/snowplow-flutter-tracker/actions/workflows/build.yml
[gh-actions-image]: https://github.com/snowplow-incubator/snowplow-flutter-tracker/actions/workflows/build.yml/badge.svg
Expand All @@ -235,9 +235,9 @@ limitations under the License.
[release-image]: https://img.shields.io/pub/v/snowplow_tracker
[releases]: https://pub.dev/packages/snowplow_tracker

[techdocs]: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/flutter-tracker/
[techdocs]: https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/flutter-tracker/
[techdocs-image]: https://d3i6fms1cm1j0i.cloudfront.net/github/images/techdocs.png
[setup]: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/flutter-tracker/quick-start-guide
[setup]: https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/flutter-tracker/quick-start-guide
[setup-image]: https://d3i6fms1cm1j0i.cloudfront.net/github/images/setup.png

[api-docs]: https://snowplow.github.io/snowplow-flutter-tracker/
Expand Down
10 changes: 5 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ group 'com.snowplowanalytics.snowplow_tracker'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.4.32'
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Expand All @@ -27,7 +27,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 30
compileSdkVersion 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand All @@ -43,11 +43,11 @@ android {
}

defaultConfig {
minSdkVersion 16
minSdkVersion 21
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.snowplowanalytics:snowplow-android-tracker:3.+"
implementation "com.snowplowanalytics:snowplow-android-tracker:4.+"
}
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.1.0"
val TRACKER_VERSION = "flutter-0.2.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ class NetworkConfigurationReader(values: Map<String, Any>) {

val endpoint: String by values
val method: String? by valuesDefault
val customPostPath: String? by valuesDefault

fun toConfiguration(): NetworkConfiguration {
if (method != null) {
return NetworkConfiguration(
endpoint,
if ("get".equals(method, true)) { HttpMethod.GET } else { HttpMethod.POST }
val networkConfig: NetworkConfiguration = if (method != null) {
NetworkConfiguration(
endpoint,
if ("get".equals(method, true)) { HttpMethod.GET } else { HttpMethod.POST }
)
} else {
return NetworkConfiguration(endpoint)
NetworkConfiguration(endpoint)
}
customPostPath?.let { networkConfig.customPostPath(it) }
return networkConfig
}
}
10 changes: 5 additions & 5 deletions doc/01-getting-started.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Getting started

Designing how and what to track in your app is an important decision. Check out our docs about tracking design [here](https://docs.snowplowanalytics.com/docs/understanding-tracking-design/introduction-to-tracking-design/).
Designing how and what to track in your app is an important decision. Check out our docs about tracking design [here](https://docs.snowplow.io/docs/understanding-tracking-design/introduction-to-tracking-design/).

The following steps will guide you through setting up the Flutter tracker in your project and tracking a simple event.

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

```yml
dependencies:
snowplow_tracker: ^0.1.0
snowplow_tracker: ^0.2.0
```

Import the package into your Dart code:
Expand All @@ -27,9 +27,9 @@ import 'package:snowplow_tracker/snowplow_tracker.dart'

### Installation on Web

If using the tracker within a Flutter app for Web, you will also need to import the Snowplow JavaScript Tracker in your `index.html` file. Please load the JS tracker with the Snowplow tag as [described in the official documentation](https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v3/tracker-setup/loading/). Do not change the global function name `snowplow` that is used to access the tracker – the Flutter APIs assume that it remains the default as shown in documentation.
If using the tracker within a Flutter app for Web, you will also need to import the Snowplow JavaScript Tracker in your `index.html` file. Please load the JS tracker with the Snowplow tag as [described in the official documentation](https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v3/tracker-setup/loading/). Do not change the global function name `snowplow` that is used to access the tracker – the Flutter APIs assume that it remains the default as shown in documentation.

Make sure to use JavaScript tracker version `3.2` or newer. You may also refer to the [example project](https://github.com/snowplow-incubator/snowplow-flutter-tracker/tree/main/example) in the Flutter tracker repository to see this in action.
Make sure to use JavaScript tracker version `3.5` or newer. You may also refer to the [example project](https://github.com/snowplow-incubator/snowplow-flutter-tracker/tree/main/example) in the Flutter tracker repository to see this in action.

## Initialization

Expand Down Expand Up @@ -66,4 +66,4 @@ Visit documentation about [tracking events](03-tracking-events.md) to learn abou

Testing that your event tracking is properly configured can be as important as testing the other aspects of your app. It confirms that you are generating the events you expect.

We provide two types of pipeline for testing and debugging. [Snowplow Mini](https://docs.snowplowanalytics.com/docs/understanding-your-pipeline/what-is-snowplow-mini/) is especially useful in manual schema and pipeline testing. [Snowplow Micro](https://docs.snowplowanalytics.com/docs/understanding-your-pipeline/what-is-snowplow-micro/) is a minimal pipeline designed to be used as part of your app's automated test suite.
We provide two types of pipeline for testing and debugging. [Snowplow Mini](https://docs.snowplow.io/docs/understanding-your-pipeline/what-is-snowplow-mini/) is especially useful in manual schema and pipeline testing. [Snowplow Micro](https://docs.snowplow.io/docs/understanding-your-pipeline/what-is-snowplow-micro/) is a minimal pipeline designed to be used as part of your app's automated test suite.
24 changes: 13 additions & 11 deletions doc/02-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The package provides a single method to initialize and configure a new tracker,
SnowplowTracker tracker = await Snowplow.createTracker(
namespace: 'ns1',
endpoint: 'http://...',
method: Method.post,
trackerConfig: const TrackerConfiguration(...),
gdprConfig: const GdprConfiguration(...),
subjectConfig: const SubjectConfiguration(...));
Expand All @@ -15,16 +14,19 @@ SnowplowTracker tracker = await Snowplow.createTracker(

The method returns a `SnowplowTracker` instance. This can be later used for tracking events, or accessing tracker properties. However, all methods provided by the `SnowplowTracker` instance are also available as static functions in the `Snowplow` class but they require passing the tracker namespace as string.

The only required attributes of the `Snowplow.createTracker` method are `namespace` used to identify the tracker, and the Snowplow collector `endpoint`. Additionally, one can configure the HTTP method to be used when sending events to the collector and provide configuration by instantiating classes for `TrackerConfiguration`, `SubjectConfiguration`, or `GdprConfiguration`. The following arguments are accepted by the `Snowplow.createTracker` method:
The only required attributes of the `Snowplow.createTracker` method are `namespace` used to identify the tracker, and the Snowplow collector `endpoint`. Additionally, one can configure the HTTP method to be used when sending events to the collector, as well as a custom POST path, and provide configuration by instantiating classes for `TrackerConfiguration`, `SubjectConfiguration`, or `GdprConfiguration`. By default, events are sent by POST. The following arguments are accepted by the `Snowplow.createTracker` method:

| Attribute | Type | Description |
|---|---|---|
| `namespace` | `String` | Tracker namespace to identify the tracker. |
| `endpoint` | `String` | URI for the Snowplow collector endpoint. |
| `method` | `Method?` | HTTP method to use. `Method.get` and `Method.post` options are available. |
| `trackerConfig` | `TrackerConfiguration?` | Configuration of the tracker and the core tracker properties. |
| `gdprConfig` | `GdprConfiguration?` | Determines the GDPR context that will be attached to all events sent by the tracker. |
| `subjectConfig` | `SubjectConfiguration?` | Subject information about tracked user and device that is added to events. |
| Attribute | Type | Description |
|---|-------------------------|--------------------------------------------------------------------------------------|
| `namespace` | `String` | Tracker namespace to identify the tracker. |
| `endpoint` | `String` | URI for the Snowplow collector endpoint. |
| `method` | `Method?` | HTTP method to use: `Method.get` or `Method.post` (`Method.post` is default). |
| `customPostPath` | `String?` | Custom POST path. |
| `trackerConfig` | `TrackerConfiguration?` | Configuration of the tracker and the core tracker properties. |
| `gdprConfig` | `GdprConfiguration?` | Determines the GDPR context that will be attached to all events sent by the tracker. |
| `subjectConfig` | `SubjectConfiguration?` | Subject information about tracked user and device that is added to events. |

Setting a custom POST path can be useful in avoiding adblockers; it replaces the default "com.snowplowanalytics/snowplow/tp2". Your event collector must also be configured to accept the custom path.

## Configuration of tracker properties: `TrackerConfiguration`

Expand Down Expand Up @@ -63,7 +65,7 @@ Some of the properties are only configurable on iOS and Android and are automati
| `screenViewport` | `Size?` | The screen viewport. ||| Non-configurable, auto-assigned. | |
| `colorDepth` | `double?` | The color depth. ||| Non-configurable, auto-assigned. | |

The configured attributes are mapped to Snowplow event properties described in the [Snowplow Tracker Protocol](https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/snowplow-tracker-protocol/). They are mapped as follows:
The configured attributes are mapped to Snowplow event properties described in the [Snowplow Tracker Protocol](https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/snowplow-tracker-protocol/). They are mapped as follows:

| Attribute | Event Property |
|---|---|
Expand Down
Loading

0 comments on commit da0e152

Please sign in to comment.