orhanobut/tracklytics is a Java project with 429 stars in the Data space. ✔️ Annotation based tracking handler with aspect oriented programming
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
We all use analytics tools to provide a better user experience. (Mixpanel, Firebase, Fabric etc). I call this concept as tracking.
Tracking events are cross-cutting and boiler plate most of the time. Tracklytics abstracts away all tracking events into annotations.
Events have a common pattern, and almost all of them have the following structure:
Event name
Event metadata as attributes (key/value pair)
How to use it
Download
Add the following code block to in your app/build.gradle.
buildscript {
dependencies {
classpath 'com.orhanobut.tracklytics:tracklytics-plugin:2.1.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.orhanobut.tracklytics' // Must be added after com.android.application
Initiate
Subscribe to all tracked events and send them to your preferred analytic tools.
Tracklytics.init(new EventSubscriber() {
@Override public void onEventTracked(Event event) {
// Send your events to Mixpanel, Fabric etc
}
});
Use
@TrackEvent("event_name")
public void foo() {
}
Guideline
@TrackEvent
Scope: Method
Track an event and notify the subscriber(EventSubscriber) on each method invocation.
@TrackEvent("event_name")
public void foo() {
}
@Attribute
Scope: Method, Method parameters
There are multiple ways to add an attribute to the corresponding event. Assigns the values in runtime dynamically.
By using method parameters: Parameter value will be used as attribute value.
@TrackEvent("event_name")
public void foo(@Attribute("attribute_key") String name) {
// something
}
By using the return value of the method as attribute value.
If the attribute values are constant, use FixedAttribute.
On method: Only this event will have this fixed attribute.
@TrackEvent("eventName")
@FixedAttribute(key="Login", value="Success")
public void foo(){
}
On class: These attributes will be added to each event that is triggered within this class.
For example: Following foo() method will also have screen_name attribute.
@FixedAttribute(key="screen_name", value="Login")
public class LoginPresenter{
@TrackEvent("login")
public void onLoggedIn(){
}
}
@FixedAttributes
Scope: Method, Class
Prior to Java 8, repeated annotations are not available. Sometimes you may need more fixed attributes. Use this annotation to add multiple attributes
Use filters to differentiate some events. You may only want to send specific events to a specific analytics tool.
ie: Send login event to Fabric.
@TrackEvent(value="event_name",filters=100)
public void foo() {
}
Tags
You can use tags to send more information about the tracked event. For example: Adjust requires token for their events.
@TrackEvent(value="event",filters=100, tags="abc123")
public void trackNoValues() {
}
Super Attributes
Some attributes might be used for every event within the app such as device id.
Tracklytics call them as super attributes. These attributes will be automatically added to each event.
You only need to set them once and Tracklytics will do the rest.
You can make the class trackable in order to provide preset values.
Imagine your domain models, they contain a lot of information and you can re-use them as a source for tracking.
For the following use case: When event is triggered, attributes from Foo.getTrackableAttributes() will be added to this event.
class Foo implements Trackable {
String name;
@Override public Map<String, String> getTrackableAttributes() {
Map<String,String> values = new HashMap<>();
values.put("name", name);
return values;
}
}
Sometimes values are not in the correct form, such as position or index is in Integer type.
This might not be clear if you track them as raw.
You may want to send a more understandable value to the analytic tools.
Use TransformAttribute to solve this issue.
For example: In the following example, index is represented by integer and you want to have a String value which represent exact value such as menu item.
Copyright 2017 Orhan Obut
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Does orhanobut/tracklytics have a project website?
No homepage URL was recorded for orhanobut/tracklytics in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
Is orhanobut/tracklytics open source?
Yes — orhanobut/tracklytics ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/orhanobut/tracklytics.
What else is in the Data space?
orhanobut/tracklytics is tracked by TopGit under the Data category, alongside 6 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is orhanobut/tracklytics?
orhanobut/tracklytics (orhanobut/tracklytics) is a Java project on GitHub. From the project's own README: ✔️ Annotation based tracking handler with aspect oriented programming
What license does orhanobut/tracklytics use?
orhanobut/tracklytics is released under the Apache-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about orhanobut/tracklytics?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/orhanobut/tracklytics is the definitive source.
Why is orhanobut/tracklytics categorized under Data?
TopGit places orhanobut/tracklytics in the Data category based on its GitHub topics and description (tagged: "analytics", "analytics-tracking", "android"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Still deciding about tracklytics?
One click hands the question to an AI along with this page — see what it says about tracklytics.