Looking for
We've rebranded!
API Docs


The PhotoEditor SDK allows you to register an object that is being notified about events in real-time. You can then send these events to an analytics service of your choice. To receive events you have to include our apt build processor into your application build.gradle file:

apply plugin: 'com.neenbedankt.android-apt'
dependencies {
    compile 'ly.img.android:photo-editor-sdk:4.0.1'
    apt 'ly.img.android:build-processor:4.0.1'

Afterwards, you have to create a custom class that extends from EventTracker. This class has to be a Parcelable and must be annotated with @ly.img.sdk.android.annotations.StateEvents.

You have to create methods that are annotated with @ly.img.sdk.android.annotations.OnEvent for all events that you want to track.

Here is an example: (You will find all possible events in the ly.img.android.PESDKEvents class)

public class CustomEventTracker extends EventTracker {
     * This annotated method tracks any tool change like opening the brush tool
    protected void changeToolView(EditorMenuState menuState) {
        googleAnalyticsTracker.send(new HitBuilders.ScreenViewBuilder().build());
     * This annotated method tracks contrast changes after a delay of 1000ms (triggerDelay) in order to prevent too many traking events.
     * ignoreReverts = true means that this event is not triggered again if you cancel the changes.
    @ly.img.sdk.android.annotations.OnEvent(value = PESDKEvents.ColorAdjustmentSettings_CONTRAST, ignoreReverts = true, triggerDelay = 1000)
    protected void onColorAdjustmentChangeContrast(ColorAdjustmentSettings colorAdjustmentSettings) {
        HitBuilders.EventBuilder builder = new HitBuilders.EventBuilder()
                .setCategory("change color adjustment")
                .setValue(Math.round(colorAdjustmentSettings.getContrast() * 100));
    // Has to be a Parcalable. For example:
    private String trackerId;
    private Tracker googleAnalyticsTracker;
    private String trackerId;
    public CustomEventTracker(String trackerId) {
    private void init(String trackerId) {
        this.trackerId = trackerId;
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(PESDK.getAppContext());
        googleAnalyticsTracker = analytics.newTracker(trackerId);
    public int describeContents() {
        return 0;
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
    protected CustomEventTracker(Parcel in) {
    public static final Creator<CustomEventTracker> CREATOR = new Creator<CustomEventTracker>() {
        public CustomEventTracker createFromParcel(Parcel source) {
            return new CustomEventTracker(source);
        public CustomEventTracker[] newArray(int size) {
            return new CustomEventTracker[size];

Now you have to add your CustomEventTracker and the build time created your.package.PESDKEvents.class to the settings class.
If this class does exist: do a “clean build” and a “rebuild” and after this, the Build Processor will create these classes.

    settingsList.setEventTracker(new CustomEventTracker(Application.ANALYTICS_TRACK_ID));

If you do not receive trackings, please verify that you have added your.package.PESDKEvents and not ly.img.android.PESDKEvents!