Được TopGit lập chỉ mục từ metadata GitHub: orhanobut/tracklytics có 429 sao, viết chủ yếu bằng Java. ✔️ Annotation based tracking handler with aspect oriented programming
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
orhanobut/tracklytics thuộc nhóm Data trên TopGit, cùng 6 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về orhanobut/tracklytics ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/orhanobut/tracklytics là nguồn chính thức.
orhanobut/tracklytics có phải mã nguồn mở không?
Có — orhanobut/tracklytics phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/orhanobut/tracklytics.
orhanobut/tracklytics có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho orhanobut/tracklytics. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
orhanobut/tracklytics dùng license gì?
orhanobut/tracklytics phát hành theo license Apache-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
orhanobut/tracklytics là gì?
orhanobut/tracklytics (orhanobut/tracklytics) là dự án Java trên GitHub. Theo mô tả gốc: ✔️ Annotation based tracking handler with aspect oriented programming
Vì sao orhanobut/tracklytics được xếp vào nhóm Data?
TopGit xếp orhanobut/tracklytics vào nhóm Data dựa trên GitHub topics và mô tả của repo (gắn thẻ: "analytics", "analytics-tracking", "android"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc tracklytics có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về tracklytics.