Example of using the Piwik PRO Tracking SDK for Android
In order to compile the demo app by yourself, complete the following steps:
-
Install and configure Android Studio and Android SDK Packages
-
Clone this repo:
git clone https://github.com/PiwikPRO/piwik-pro-sdk-demo-android.git -
Open the cloned folder in Android Studio as a new project and configure Gradle
-
In the terminal, run
./gradlew :exampleapp:assembleDebug -
Copy the .apk file from
exampleapp/build/outputs/apk/exampleapp-debug.apkto your device and open it
If You want to run application:
- configure Android Emulator in AVD Manager (make sou've downloaded a system image and Builds Tools in the SDK Manager)
- run "exampleapp" by clicking the play icon or "Ctrl+Shift+A"
To connect the app to your Piwik PRO instance, go to Settings and set your instance URL and website ID. Use "Update Host and Site ID" to save your settings. Then, you can log into your instance and go to "Analytics -> Settings -> Tracker debugger" to see the data in real-time.
The app supports tracking Analytics events:
- Screen Views
- Goals
- Custom Events
- Custom Dimensions
- Custom Variables
- Downloads
- Outlinks
- Search
- Content Impressions
- Exceptions
- Ecommerce: Items, Cart update, Orders
- Social Interactions
- Campaigns
The app also supports using the Audience Manager methods in the SDK:
- Track user profile attributes
- Read user profile attributes
- Check Audience membership
There's also a Settings activity with customizable "dry run", "opt out" and "session timeout", "prefixing" parameters.
Please direct any feedback to https://github.com/PiwikPRO/piwik-pro-sdk-demo-android/issues