Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@
[submodule "kits/iterable-kit"]
path = kits/iterable-kit
url = git@github.com:mparticle-integrations/mparticle-android-integration-iterable.git
[submodule "kits/kochava-kit"]
path = kits/kochava-kit
url = git@github.com:mParticle-integrations/mparticle-android-integration-kochava.git
[submodule "kits/leanplum-kit"]
path = kits/leanplum-kit
url = git@github.com:mparticle-integrations/mparticle-android-integration-leanplum.git
Expand Down
1 change: 1 addition & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ lint:
- kits/braze/braze-38/**
- kits/ga/ga-23/**
- kits/ga4/ga4-23/**
- kits/kochava/kochava-5/**
- kits/rokt/rokt/**
actions:
enabled:
Expand Down
1 change: 0 additions & 1 deletion kits/kochava-kit
Submodule kochava-kit deleted from 65855e
107 changes: 107 additions & 0 deletions kits/kochava/kochava-5/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
## Kochava Kit Integration

This repository contains the [Kochava](https://www.kochava.com) integration for the [mParticle Android SDK](https://github.com/mParticle/mparticle-android-sdk).

### Adding the integration

```
1. Add the kit dependency to your app's build.gradle:

```groovy
dependencies {
implementation 'com.mparticle:android-kochava-kit:5+'
}
```
2. Add the following dependencies to enable various Kochava capabilites.

>
> NOTE: Starting with Play Services 15 the dependency requirements have changed. The Android Advertising ID (adid) collection has moved out of play-services “base” and into “ads-identifier”. Use the appropriate option for the version of Play Services you are using as indicated below.
>
> ```
> dependencies {
>
> //Required: Google Play Services Ads Identifier (If publishing to the Google Play Store)
> implementation 'com.google.android.gms:play-services-ads-identifier:15.0.1'
> //Required: If using Play Services prior to version 15.
> //implementation 'com.google.android.gms:play-services-base:12.0.1'
>
> //Required: Install Referrer (If publishing to the Google Play Store)
> implementation 'com.android.installreferrer:installreferrer:1+'
>
> //Optional: Location Collection. Note: This feature must also be enabled server side before collection will occur.
> implementation 'com.google.android.gms:play-services-location:15.0.1'
>
> //Optional: Instant App Status Collection
> implementation 'com.google.android.instantapps:instantapps:1.1.0'
> }
> ```
> https://support.kochava.com/sdk-integration/sdk-kochavatracker-android/_


3. Follow the mParticle Android SDK [quick-start](https://github.com/mParticle/mparticle-android-sdk), then rebuild and launch your app, and verify that you see `"Kochava detected"` in the output of `adb logcat`.
4. Reference mParticle's integration docs below to enable the integration.

### Documentation

[Kochava integration](https://docs.mparticle.com/integrations/kochava/event/)

### IdentityLink

If you would like to associate the Account Identity with a custom Identifier that is not the Device Identity, you can include the data in the Kochava kit's initialization, by calling `KochavaKit.setIdentityLink` before `MParticle.start()`

```
Map<String, String> identityLink = new HashMap<String, String>();
identityLink.put("key1", "identity1");
identityLink.put("key2", "identity2");
KochavaKit.setIdentityLink(identityLink);
```

### Attribution, Deeplinking and Enhanced Deeplinking results

Kochava offers a number of APIs to process attribution and deeplinking data. In our abstraction, the
results from these are all routed to our `AttributionListener` under distinct, constant keys.

```kotlin
val attributionListener = object: AttributionListener {
override fun onResult(result: AttributionResult) {
when (result.serviceProviderId) {
MParticle.ServiceProviders.KOCHAVA -> {
val parameters = result.parameters ?: JSONObject()

//process Attribution results
if (parameters.has(KochavaKit.ATTRIBUTION_PARAMETERS)) {
val attributionParamters =
parameters.getJSONObject(KochavaKit.ATTRIBUTION_PARAMETERS)
}

//process Deeplink results
if (parameters.has(KochavaKit.DEEPLINK_PARAMETERS)) {
val deeplinkParameters =
parameters.getJSONObject(KochavaKit.DEEPLINK_PARAMETERS)
}

//process Enhanced Deeplink results
if (parameters.has(KochavaKit.ENHANCED_DEEPLINK_PARAMETERS)) {
val enhancedDeeplinkParameters =
parameters.getJSONObject(KochavaKit.ENHANCED_DEEPLINK_PARAMETERS)
}
}
}
}

override fun onError(error: AttributionError) {
//error handling
}
}

MParticle.start(
MParticleOptions.builder(this)
.attributionListener(attributionListener)
.build()
)

```

### License

[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)
66 changes: 66 additions & 0 deletions kits/kochava/kochava-5/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
buildscript {
ext.kotlin_version = '2.0.20'
if (!project.hasProperty('version') || project.version.equals('unspecified')) {
project.version = '+'
}

repositories {
google()
mavenLocal()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.1.4'
classpath 'com.mparticle:android-kit-plugin:' + project.version
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

plugins {
id "org.sonarqube" version "3.5.0.2730"
id "org.jlleitschuh.gradle.ktlint" version "13.0.0"
}

sonarqube {
properties {
property "sonar.projectKey", "mparticle-android-integration-kochava"
property "sonar.organization", "mparticle"
property "sonar.host.url", "https://sonarcloud.io"
}
}

apply plugin: 'org.jlleitschuh.gradle.ktlint'
apply plugin: 'kotlin-android'
apply plugin: 'com.mparticle.kit'

android {
namespace 'com.mparticle.kits.kochava'
buildFeatures {
buildConfig = true
}
defaultConfig {
minSdkVersion 16
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
testOptions {
unitTests.all {
jvmArgs += ['--add-opens', 'java.base/java.lang=ALL-UNNAMED']
}
}
}

dependencies {
def kochava_tracker_version = "5.4.0"
implementation("com.kochava.tracker:tracker:$kochava_tracker_version") // Required
implementation("com.kochava.tracker:events:$kochava_tracker_version") // Optional
implementation("com.kochava.tracker:engagement:$kochava_tracker_version") // Optional
implementation("com.kochava.tracker:datapointnetwork:$kochava_tracker_version") // Optional
implementation("com.kochava.tracker:legacyreferrer:$kochava_tracker_version") // Optional
}
3 changes: 3 additions & 0 deletions kits/kochava/kochava-5/consumer-proguard.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are the proguard rules specified by the Kochava SDK's documentation

-keep class kochava.android.** { *; }
4 changes: 4 additions & 0 deletions kits/kochava/kochava-5/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
android.enableJetifier=true
android.useAndroidX=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2560m
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading