Google Analytics ME Wiki (Support us!)
Google Analytics ME is a compelling and well defined API for Java ME developers who wish to integrate their apps into Google Analytics. With this API, developers will be able to prepare their apps to send out useful data, about how users are interacting with them. Those data will be valuable to identify, e.g., audience and improvement points.
Table of Contents:
Licensing
Google Analytics ME is under two licenses: GNU General Public License v2.0 regarding the source code and GNU Lesser General Public License v3.0 for the binaries. It means that now you can develop proprietary applications with Google Analytics ME' if you merely link them to API's binaries.
Minimum Requirements
- Java Micro Edition (MIDP 2.0 / CLDC 1.0) or newer
- Internet connection (e.g. GPRS, EDGE, 3G, wi-fi, etc)
- Google Analytics account
Update History
Google Analytics ME is now at its fourth release (2.0). This last version consists of bug fixes and new features.
| Version | Date | Contents |
|---|---|---|
| ||
| ||
| ||
|
Sample Codes
In order to help you to quick learn how to work with Google Analytics ME, here it goes some sample codes showing how to perform some common tasks.
- Tracking how many times a MIDlet is started up:
public class MediaPlayerMIDlet extends MIDlet {
public AppMIDlet() {
...
Tracker tracker = Tracker.getInstance(this, "UA-1736743-0");
tracker.addToQueue(new PageView("/midlet_started"));
...
}
...
}
- Tracking how many times a screen is displayed:
public class MediaPlayerScreen extends Form {
...
public void commandAction(Command c, Displayable d) {
if (c == cmdSongDetail) {
Tracker tracker = Tracker.getInstance(midlet, "UA-1736743-0");
tracker.addToQueue(new PageView("/song_detail"));
//
display.setCurrent(detailScreen);
}
...
}
...
}
- Tracking how many times a function of a screen is performed:
...
public void play() {
Tracker tracker = Tracker.getInstance(midlet, "UA-1736743-0");
tracker.addToQueue(new Event("/media_player", "Play", null, null));
...
}
...
- Tracking events synchronously:
...
public void rewind() {
Tracker tracker = Tracker.getInstance(midlet, "UA-1736743-0");
tracker.track(new Event("/media_player", "Rewind", null, null));
...
}
...
- Explicitly *flushing all queued events:
public class MediaPlayerMIDlet extends MIDlet {
...
public void destroyApp(boolean unconditional) {
Tracker tracker = Tracker.getInstance(this, "UA-1736743-0");
tracker.flush(false);
}
}
*Make to sure to call this method (synchronously) before the app is destroyed. Otherwise, any queued requests will be lost.
Donation
In case of Google Analytics ME has brought good benefits for you and/or your company, and because of that you would like to thank us for all our hard work. Please, feel free to donate us any amount, via PayPal, by clicking here. It is easy and quick to do. In addition, this contribution will provide us more resources to keep up improving this API for you.





