Class CounterAttribute

java.lang.Object
io.appmetrica.analytics.profile.CounterAttribute

public final class CounterAttribute extends Object
The counter attribute class. It enables creating custom counter for the user profile.

EXAMPLE:

     CounterAttribute timeLeftAttribute = Attribute.customCounter("time_left");
     UserProfile userProfile = new UserProfile.Builder()
                     .apply(Attribute.timeLeftAttribute().withDelta(-10d))
                     .build();
 
  • Method Details

    • withDelta

      @NonNull public UserProfileUpdate<? extends io.appmetrica.analytics.impl.profile.UserProfileUpdatePatcher> withDelta(double value)
      Updates the counter attribute value with the specified delta value.
      Parameters:
      value - Delta value to change the counter attribute value
      Returns:
      The UserProfileUpdate object