Skip to content

Commit

Permalink
Merge pull request #149 from MetaMask/analytics
Browse files Browse the repository at this point in the history
chore: update analytics tracking
  • Loading branch information
elefantel authored Oct 2, 2024
2 parents 7e2da21 + cf47ae8 commit a448378
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 deletions.
4 changes: 2 additions & 2 deletions metamask-android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
targetSdk 33

ext.versionCode = 1
ext.versionName = "0.6.5"
ext.versionName = "0.6.6"

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles 'consumer-rules.pro'
Expand Down Expand Up @@ -67,7 +67,7 @@ dependencies {

ext {
PUBLISH_GROUP_ID = 'io.metamask.androidsdk'
PUBLISH_VERSION = '0.6.5'
PUBLISH_VERSION = '0.6.6'
PUBLISH_ARTIFACT_ID = 'metamask-android-sdk'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ interface Tracker {

class Endpoints {
companion object {
private const val BASE_URL = "https://metamask-sdk-socket.metafi.codefi.network"
const val ANALYTICS = "$BASE_URL/debug"
private const val BASE_URL = "https://metamask-sdk.api.cx.metamask.io"
const val ANALYTICS = "$BASE_URL/evt"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,15 @@ class CommunicationClient(
)
parameters.putAll(params)

when(event) {
Event.SDK_CONNECTION_REQUEST_STARTED -> {
parameters["commLayer"] = SDKInfo.PLATFORM
parameters["sdkVersion"] = SDKInfo.VERSION
parameters["url"] = dappMetadata?.url ?: ""
parameters["title"] = dappMetadata?.name ?: ""
parameters["platform"] = SDKInfo.PLATFORM
parameters["channelId"] = sessionId
}
Event.SDK_RPC_REQUEST -> {
parameters["commLayer"] = SDKInfo.PLATFORM
parameters["sdkVersion"] = SDKInfo.VERSION
parameters["url"] = dappMetadata?.url ?: ""
parameters["title"] = dappMetadata?.name ?: ""
parameters["platform"] = SDKInfo.PLATFORM
parameters["timestamp"] = TimeStampGenerator.timestamp()
parameters["channelId"] = sessionId
parameters["from"] = "mobile"
}
else -> Unit
}
parameters["commLayer"] = SDKInfo.PLATFORM
parameters["sdkVersion"] = SDKInfo.VERSION
parameters["url"] = dappMetadata?.url ?: ""
parameters["title"] = dappMetadata?.name ?: ""
parameters["platform"] = SDKInfo.PLATFORM
parameters["timestamp"] = TimeStampGenerator.timestamp()
parameters["channelId"] = sessionId
parameters["dappId"] = appContextRef.get()?.packageName ?: "N/A"
parameters["from"] = "mobile"
tracker.trackEvent(event, parameters)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.metamask.androidsdk

object SDKInfo {
const val VERSION = "0.6.5"
const val VERSION = "0.6.6"
const val PLATFORM = "android"
}

0 comments on commit a448378

Please sign in to comment.