Skip to content

Commit da0e152

Browse files
committed
Merge branch 'release/0.2.0'
2 parents c0fe3e3 + f69ced8 commit da0e152

39 files changed

+226
-296
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
flutter: ['2.8.0']
9+
flutter: ['3.0.0']
1010
steps:
1111
- uses: actions/checkout@v2
1212
- uses: subosito/flutter-action@v1
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v2
2424
- uses: subosito/flutter-action@v1
2525
with:
26-
flutter-version: '2.8.0'
26+
flutter-version: '3.0.0'
2727
channel: 'stable'
2828
- run: flutter pub get
2929
- run: flutter analyze
@@ -60,7 +60,7 @@ jobs:
6060
# -- Integration tests --
6161
- uses: subosito/flutter-action@v1
6262
with:
63-
flutter-version: '2.8.0'
63+
flutter-version: '3.0.0'
6464
channel: 'stable'
6565

6666
- name: Run Flutter Driver tests
@@ -108,7 +108,7 @@ jobs:
108108

109109
- uses: subosito/flutter-action@v1
110110
with:
111-
flutter-version: '2.8.0'
111+
flutter-version: '3.0.0'
112112
channel: 'stable'
113113

114114
- run: "flutter clean"
@@ -146,7 +146,7 @@ jobs:
146146
# -- Integration tests --
147147
- uses: subosito/flutter-action@v1
148148
with:
149-
flutter-version: '2.8.0'
149+
flutter-version: '3.0.0'
150150
channel: 'stable'
151151

152152
- run: chromedriver --port=4444 &

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
flutter: ['2.8.0']
14+
flutter: ['3.0.0']
1515
steps:
1616
- uses: actions/checkout@v2
1717
- uses: subosito/flutter-action@v1

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.2.0
2+
* Configure custom POST path (#15)
3+
* Upgrade underlying mobile native trackers to version 4 (#17)
4+
* Fix schema link in documentation for ScreenView (#12)
5+
* Remove loading custom JavaScript for session context and reading cookies (#13)
6+
* Upgrade min Flutter, Dart and Android SDK versions and upgrade dependencies (#19) - thanks @koga for the Android work!
7+
18
# 0.1.0
29

310
* Add route observer for auto tracking screen or page view events on navigation (#9)

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Snowplow Flutter Tracker is maintained by the Engineering team at Snowplow A
44

55
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.
66

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

99
## Setting up an Environment
1010

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

1717
### Creating an issue
1818

19-
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.
19+
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.
2020

2121
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.
2222

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

7676
### Community support requests
7777

78-
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/.
78+
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/.
7979

8080
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!

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This will add a line with the dependency like this to your `pubspec.yaml`:
4747

4848
```yml
4949
dependencies:
50-
snowplow_tracker: ^0.1.0
50+
snowplow_tracker: ^0.2.0
5151
```
5252
5353
Import the package into your Dart code:
@@ -58,9 +58,9 @@ import 'package:snowplow_tracker/snowplow_tracker.dart'
5858

5959
#### Installation on Web
6060

61-
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.
61+
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.
6262

63-
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.
63+
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.
6464

6565
### Using the Tracker
6666

@@ -223,8 +223,8 @@ limitations under the License.
223223

224224
[website]: https://snowplowanalytics.com
225225
[snowplow]: https://github.com/snowplow/snowplow
226-
[docs]: https://docs.snowplowanalytics.com/
227-
[flutter-docs]: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/flutter-tracker/
226+
[docs]: https://docs.snowplow.io/
227+
[flutter-docs]: https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/flutter-tracker/
228228

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

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

243243
[api-docs]: https://snowplow.github.io/snowplow-flutter-tracker/

android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ group 'com.snowplowanalytics.snowplow_tracker'
22
version '1.0-SNAPSHOT'
33

44
buildscript {
5-
ext.kotlin_version = '1.4.32'
5+
ext.kotlin_version = '1.7.10'
66
repositories {
77
google()
88
mavenCentral()
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:4.1.0'
12+
classpath 'com.android.tools.build:gradle:4.1.3'
1313
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1515
}
@@ -27,7 +27,7 @@ apply plugin: 'kotlin-android'
2727
apply plugin: 'kotlin-android-extensions'
2828

2929
android {
30-
compileSdkVersion 30
30+
compileSdkVersion 31
3131

3232
compileOptions {
3333
sourceCompatibility JavaVersion.VERSION_1_8
@@ -43,11 +43,11 @@ android {
4343
}
4444

4545
defaultConfig {
46-
minSdkVersion 16
46+
minSdkVersion 21
4747
}
4848
}
4949

5050
dependencies {
5151
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
52-
implementation "com.snowplowanalytics:snowplow-android-tracker:3.+"
52+
implementation "com.snowplowanalytics:snowplow-android-tracker:4.+"
5353
}

android/src/main/kotlin/com/snowplowanalytics/snowplow_tracker/TrackerVersion.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
package com.snowplowanalytics.snowplow_tracker
1313

1414
object TrackerVersion {
15-
val TRACKER_VERSION = "flutter-0.1.0"
15+
val TRACKER_VERSION = "flutter-0.2.0"
1616
}

android/src/main/kotlin/com/snowplowanalytics/snowplow_tracker/readers/configurations/NetworkConfigurationReader.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ class NetworkConfigurationReader(values: Map<String, Any>) {
1919

2020
val endpoint: String by values
2121
val method: String? by valuesDefault
22+
val customPostPath: String? by valuesDefault
2223

2324
fun toConfiguration(): NetworkConfiguration {
24-
if (method != null) {
25-
return NetworkConfiguration(
26-
endpoint,
27-
if ("get".equals(method, true)) { HttpMethod.GET } else { HttpMethod.POST }
25+
val networkConfig: NetworkConfiguration = if (method != null) {
26+
NetworkConfiguration(
27+
endpoint,
28+
if ("get".equals(method, true)) { HttpMethod.GET } else { HttpMethod.POST }
2829
)
2930
} else {
30-
return NetworkConfiguration(endpoint)
31+
NetworkConfiguration(endpoint)
3132
}
33+
customPostPath?.let { networkConfig.customPostPath(it) }
34+
return networkConfig
3235
}
3336
}

doc/01-getting-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Getting started
22

3-
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/).
3+
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/).
44

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

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

1717
```yml
1818
dependencies:
19-
snowplow_tracker: ^0.1.0
19+
snowplow_tracker: ^0.2.0
2020
```
2121
2222
Import the package into your Dart code:
@@ -27,9 +27,9 @@ import 'package:snowplow_tracker/snowplow_tracker.dart'
2727

2828
### Installation on Web
2929

30-
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.
30+
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.
3131

32-
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.
32+
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.
3333

3434
## Initialization
3535

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

6767
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.
6868

69-
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.
69+
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.

doc/02-configuration.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ The package provides a single method to initialize and configure a new tracker,
66
SnowplowTracker tracker = await Snowplow.createTracker(
77
namespace: 'ns1',
88
endpoint: 'http://...',
9-
method: Method.post,
109
trackerConfig: const TrackerConfiguration(...),
1110
gdprConfig: const GdprConfiguration(...),
1211
subjectConfig: const SubjectConfiguration(...));
@@ -15,16 +14,19 @@ SnowplowTracker tracker = await Snowplow.createTracker(
1514

1615
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.
1716

18-
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:
17+
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:
1918

20-
| Attribute | Type | Description |
21-
|---|---|---|
22-
| `namespace` | `String` | Tracker namespace to identify the tracker. |
23-
| `endpoint` | `String` | URI for the Snowplow collector endpoint. |
24-
| `method` | `Method?` | HTTP method to use. `Method.get` and `Method.post` options are available. |
25-
| `trackerConfig` | `TrackerConfiguration?` | Configuration of the tracker and the core tracker properties. |
26-
| `gdprConfig` | `GdprConfiguration?` | Determines the GDPR context that will be attached to all events sent by the tracker. |
27-
| `subjectConfig` | `SubjectConfiguration?` | Subject information about tracked user and device that is added to events. |
19+
| Attribute | Type | Description |
20+
|---|-------------------------|--------------------------------------------------------------------------------------|
21+
| `namespace` | `String` | Tracker namespace to identify the tracker. |
22+
| `endpoint` | `String` | URI for the Snowplow collector endpoint. |
23+
| `method` | `Method?` | HTTP method to use: `Method.get` or `Method.post` (`Method.post` is default). |
24+
| `customPostPath` | `String?` | Custom POST path. |
25+
| `trackerConfig` | `TrackerConfiguration?` | Configuration of the tracker and the core tracker properties. |
26+
| `gdprConfig` | `GdprConfiguration?` | Determines the GDPR context that will be attached to all events sent by the tracker. |
27+
| `subjectConfig` | `SubjectConfiguration?` | Subject information about tracked user and device that is added to events. |
28+
29+
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.
2830

2931
## Configuration of tracker properties: `TrackerConfiguration`
3032

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

66-
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:
68+
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:
6769

6870
| Attribute | Event Property |
6971
|---|---|

0 commit comments

Comments
 (0)