Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/6.0.0 #671

Merged
merged 21 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a4ff351
Flush events only when the buffer is full (close #648)
matus-tomlein Nov 29, 2023
bf8eeae
Change default buffer option to single (close #649)
matus-tomlein Nov 29, 2023
701086e
Make network requests serially in network connection (close #646)
matus-tomlein Nov 30, 2023
dd9f1af
Add screen engagement tracking of time spent and list items scrolled …
matus-tomlein Jan 12, 2024
5975f74
Do not track the screen view again when app comes to foreground (clos…
matus-tomlein Jan 12, 2024
2bb37f5
Update Emitter constructor to accept namespace and event store and ma…
matus-tomlein Jan 18, 2024
7a7d9a5
Change default emit timeout from 5 seconds to 30 seconds (close #658)
matus-tomlein Jan 18, 2024
5691cf5
Fix returning error from network connection requests
matus-tomlein Jan 18, 2024
565b009
Remove unused threadCount property from Tracker
matus-tomlein Jan 18, 2024
1789fe5
Set default thread count in Executor to match the default thread pool…
matus-tomlein Jan 18, 2024
a472a2e
Remove optional types in event store interface
matus-tomlein Jan 17, 2024
e56da18
Add configurable limit for the maximum age and number of events in th…
matus-tomlein Jan 17, 2024
c51096d
Fix demo crash when using R8 full mode (close #652) (#663)
mscwilson Jan 25, 2024
394d907
Undeprecate PageView event (close #665)
mscwilson Jan 26, 2024
334ebbe
Handle errors when fetching screen resolution in Subject (close #657)
mscwilson Jan 27, 2024
fbe62a0
Tidy AbstractEvent internal properties (close #666)
mscwilson Jan 29, 2024
4ba0672
Add an option to override platform context properties (close #667)
matus-tomlein Jan 30, 2024
2c6df7e
Add API to decorate link with user/session info (close #639)
greg-el Sep 5, 2023
bb1d65f
Update copyright notices (close #669)
mscwilson Jan 30, 2024
9e5a3b9
Enable lifecycle autotracking by default (close #651)
matus-tomlein Feb 1, 2024
2bae43a
Prepare for v6.0.0 release
mscwilson Feb 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
Version 6.0.0 (2024-02-01)
--------------------------
Enable lifecycle autotracking by default (#651)
Update copyright notices (#669)
Add API to decorate link with user/session info (#639)
Add an option to override platform context properties (#667)
Tidy AbstractEvent internal properties (#666)
Handle errors when fetching screen resolution in Subject (#657)
Undeprecate PageView event (#665)
Fix demo crash when using R8 full mode (#652)
Add configurable limit for the maximum age and number of events in the event store and remove old events before sending (#660)
Remove optional types in event store interface (#661)
Set default thread count in Executor to match the default thread pool size in the Emitter (#659)
Remove unused threadCount property from Tracker (#659)
Fix returning error from network connection requests (#659)
Change default emit timeout from 5 seconds to 30 seconds (#658)
Update Emitter constructor to accept namespace and event store and make them immutable (#659)
Do not track the screen view again when app comes to foreground (#653)
Add screen engagement tracking of time spent and list items scrolled on a screen (#654)
Make network requests serially in network connection (#646)
Change default buffer option to single (#649)
Flush events only when the buffer is full (#648)

Version 5.6.0 (2023-10-12)
--------------------------
Add configuration to send requests with user ID to a Focal Meter endpoint (#571)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023 Snowplow Analytics Ltd.
Copyright 2015-present Snowplow Analytics Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Three demo apps are included in this repository: one in [Java](https://github.co

## Copyright and license

The Snowplow Android Tracker is copyright 2015-2023 Snowplow Analytics Ltd.
The Snowplow Android Tracker is copyright 2015-present Snowplow Analytics Ltd.

Licensed under the **[Apache License, Version 2.0][license]** (the "License");
you may not use this software except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.6.0
6.0.0
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins {

subprojects {
group = 'com.snowplowanalytics'
version = '5.6.0'
version = '6.0.0'
repositories {
google()
maven {
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ systemProp.org.gradle.internal.http.socketTimeout=120000
SONATYPE_STAGING_PROFILE=comsnowplowanalytics
GROUP=com.snowplowanalytics
POM_ARTIFACT_ID=snowplow-android-tracker
VERSION_NAME=5.6.0
VERSION_NAME=6.0.0

POM_NAME=snowplow-android-tracker
POM_PACKAGING=aar
Expand All @@ -50,3 +50,4 @@ POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=snowplow
POM_DEVELOPER_NAME=Snowplow Analytics
android.enableR8.fullMode=true
8 changes: 7 additions & 1 deletion snowplow-demo-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ android {

buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down Expand Up @@ -60,6 +61,11 @@ dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':snowplow-android-tracker')

implementation 'com.google.android.gms:play-services-appset:16.0.2'
implementation 'com.google.android.gms:play-services-ads:22.6.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
implementation "com.android.installreferrer:installreferrer:2.2"

implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.0.0"
Expand Down
17 changes: 16 additions & 1 deletion snowplow-demo-compose/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,19 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# Fixes R8 full mode crash
# Also see https://github.com/square/retrofit/issues/3751
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation

# Reflection for the appSetId
-keep class com.google.android.gms.appset.AppSet { *; }
-keep class com.google.android.gms.appset.AppSetIdInfo { *; }
-keep class com.google.android.gms.internal.appset.zzr { *; }
-keep class com.google.android.gms.tasks.Tasks { *; }

# Reflection for the AAID (AndroidIdfa)
-keep class com.google.android.gms.ads.identifier.** { *; }
5 changes: 4 additions & 1 deletion snowplow-demo-compose/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Snowplowandroidtracker">
<!-- Sample Ad Manager app ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
<activity
android:name=".MainActivity"
android:exported="true"
Expand All @@ -24,5 +28,4 @@
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.snowplowanalytics.snowplow.configuration.NetworkConfiguration
import com.snowplowanalytics.snowplow.configuration.TrackerConfiguration
import com.snowplowanalytics.snowplow.controller.TrackerController
import com.snowplowanalytics.snowplow.emitter.BufferOption
import com.snowplowanalytics.snowplow.event.ListItemView
import com.snowplowanalytics.snowplow.event.ScreenView
import com.snowplowanalytics.snowplow.network.HttpMethod
import com.snowplowanalytics.snowplow.payload.SelfDescribingJson
Expand All @@ -20,7 +21,9 @@ object Tracking {
fun setup(namespace: String) : TrackerController {
// Replace this collector endpoint with your own
val networkConfig = NetworkConfiguration("https://23a6-82-26-43-253.ngrok.io", HttpMethod.POST)
val trackerConfig = TrackerConfiguration("appID").logLevel(LogLevel.DEBUG)
val trackerConfig = TrackerConfiguration("appID")
.logLevel(LogLevel.DEBUG)
.screenViewAutotracking(false)
val emitterConfig = EmitterConfiguration().bufferOption(BufferOption.Single)

return Snowplow.createTracker(
Expand All @@ -44,7 +47,16 @@ object Tracking {
entities: List<SelfDescribingJson>? = null,
) {
LaunchedEffect(Unit, block = {
val event = ScreenView(screenName).entities(entities)
val event = ScreenView(screenName)
entities?.let { event.entities(it) }
Snowplow.defaultTracker?.track(event)
})
}

@Composable
fun TrackListItemView(index: Int, itemsCount: Int?) {
LaunchedEffect(Unit, block = {
val event = ListItemView(index, itemsCount)
Snowplow.defaultTracker?.track(event)
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ fun SchemaDetailScreen(
"iglu:com.snowplowanalytics.iglu/anything-a/jsonschema/1-0-0",
hashMapOf("name" to schemaParts.name, "vendor" to schemaParts.vendor)
)
Tracking.ManuallyTrackScreenView("schema_detail", entities = listOf(entity))


Scaffold(
topBar = {
TopAppBar(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowForward
Expand All @@ -16,6 +17,7 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.snowplowanalytics.snowplowdemocompose.R
import com.snowplowanalytics.snowplowdemocompose.data.SchemaUrlParts
import com.snowplowanalytics.snowplowdemocompose.data.Tracking

@Composable
fun SchemaListScreen(
Expand All @@ -38,7 +40,11 @@ fun SchemaListScreen(
if (vm.errorMessage.isEmpty()) {
Column(modifier = Modifier.padding(contentPadding)) {
LazyColumn(modifier = Modifier.fillMaxHeight()) {
items(vm.schemaPartsList) { schema ->
itemsIndexed(vm.schemaPartsList) { index, schema ->
Tracking.TrackListItemView(
index = index,
itemsCount = vm.schemaPartsList.size
)
SchemaCard(schema = schema, onClick = onSchemaClicked)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down Expand Up @@ -295,9 +295,7 @@ private boolean setupWithLocalConfig() {
NetworkConfiguration networkConfiguration = new NetworkConfiguration(uri, method);
EmitterConfiguration emitterConfiguration = new EmitterConfiguration()
.requestCallback(getRequestCallback())
.bufferOption(BufferOption.DefaultGroup)
.threadPoolSize(20)
.emitRange(500)
.byteLimitPost(52000);
TrackerConfiguration trackerConfiguration = new TrackerConfiguration(appId)
.logLevel(LogLevel.VERBOSE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
11 changes: 10 additions & 1 deletion snowplow-demo-kotlin/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,13 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile

# Reflection for the appSetId
-keep class com.google.android.gms.appset.AppSet { *; }
-keep class com.google.android.gms.appset.AppSetIdInfo { *; }
-keep class com.google.android.gms.internal.appset.zzr { *; }
-keep class com.google.android.gms.tasks.Tasks { *; }

# Reflection for the AAID (AndroidIdfa)
-keep class com.google.android.gms.ads.identifier.** { *; }
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down Expand Up @@ -260,9 +260,8 @@ class Demo : Activity(), LoggerDelegate {
val networkConfiguration = NetworkConfiguration(uri, method)
val emitterConfiguration = EmitterConfiguration()
.requestCallback(requestCallback)
.bufferOption(BufferOption.DefaultGroup)
.bufferOption(BufferOption.SmallGroup)
.threadPoolSize(20)
.emitRange(500)
.byteLimitPost(52000)
val trackerConfiguration = TrackerConfiguration(appId)
.logLevel(LogLevel.VERBOSE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down Expand Up @@ -46,4 +46,3 @@ class VideoView : android.widget.VideoView {
viewController?.onSeekStart()
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down Expand Up @@ -178,4 +178,3 @@ class VideoViewController(activity: Activity, uri: Uri) {
private val TAG = VideoViewController::class.java.simpleName
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand All @@ -24,14 +24,21 @@ class AbstractEventTest {
@Test
fun testAddsEntitiesUsingAllAPIs() {
val event = ScreenView("screen")
val entity1 = SelfDescribingJson("schema1", "data1")
val entity2 = SelfDescribingJson("schema2", "data2")
val entity3 = SelfDescribingJson("schema3", "data3")

event.entities.add(SelfDescribingJson("schema1", "data1"))
event.customContexts.add(SelfDescribingJson("schema2", "data2"))
event.entities(listOf(SelfDescribingJson("schema3", "data3")))
event.contexts(listOf(SelfDescribingJson("schema4", "data4")))

Assert.assertEquals(4, event.entities.count())
Assert.assertEquals(4, event.contexts.count())
Assert.assertEquals(4, event.customContexts.count())
event.entities.add(entity1)
Assert.assertEquals(1, event.entities.count())

event.entities(listOf(entity2))
Assert.assertEquals(2, event.entities.count())

event.contexts(listOf(entity3))
Assert.assertEquals(3, event.entities.count())
Assert.assertEquals(3, event.contexts.count())
Assert.assertTrue(event.entities.contains(entity1))
Assert.assertTrue(event.entities.contains(entity2))
Assert.assertTrue(event.entities.contains(entity3))
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2023 Snowplow Analytics Ltd. All rights reserved.
* Copyright (c) 2015-present Snowplow Analytics Ltd. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
Expand Down
Loading
Loading