Grab Eulerian Analytics SDK via Gradle.
dependencies {
compile 'com.eulerian.android.sdk:eanalytics:1.6.5'
}
In your AndroidManifest.xml, add the following permissions :
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Also add the following declaration within the element to track the install referrer.
<receiver
android:name="com.eulerian.android.sdk.InstallReferrerReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
Before using the SDK make sure to initialize it, in your Application onCreate() for instance.
<!-- in your AndroidManifest.xml-->
<application
android:name=".DemoApp">
public class DemoApp extends Application {
@Override
public void onCreate() {
super.onCreate();
EAnalytics.init(this, "example.demo.com", false);
}
}
Now you can track any properties you want. The generic properties is EAProperties, and the SDK provides convenience classes for the most common usage (ie. EACart, EAEstimate, EAProducts, etc...)
EASearch search = new EASearch.Builder("/path-example", "banana")
.setParams(new Params.Builder()
.addParam("provenance", "martinique")
.addParam("couleur", "jaune")
.build())
.setResults(42)
.build();
EAnalytics.getInstance().track(search)
Please note that Eulerian Analytics SDK includes the following dependencies :
- com.google.android.gms:play-services-base:9.2.0
Step 1 to 3 has been reduced in simply grabbing Eulerian Analytics sdk via Gradle.
Link to Android tagging plan