Mobile: Incremental Super Properties

Mixpanel super properties are a dictionary of properties stored on the client device that get added to every event before it is sent. Super properties are only for Events, not for properties stored on User Profiles. You can learn more in our article about the difference between super properties and user profile properties.

To implement "incremental super properties" you need to get the super property value from the super property dictionary, add 1 to it, and then re-register the new value for that super property.

iOS Objective-C

Mixpanel *mixpanel = [Mixpanel sharedInstance];
NSDictionary *superProps = [mixpanel currentSuperProperties];
NSNumber *propToIncrement = superProps[@"Some Super Property"];
int value = [propToIncrement intValue];
propToIncrement = [NSNumber numberWithInt:value + 1];
[mixpanel registerSuperProperties:@{@"Some Super Property": propToIncrement}];

iOS Swift

   let mixpanel = Mixpanel.mainInstance()
   let superprops = mixpanel.currentSuperProperties()
   if (superprops["incrementer"] != nil){
     if var i = superprops["incrementer"] as? Int{
       mixpanel.registerSuperProperties(["incrementer": i])


mixpanel = MixpanelAPI.getInstance(this, projectToken);
JSONObject sprops = mixpanel.getSuperProperties();
if (sprops.has("Incrementer")) {
    int i = sprops.getInt("Incrementer");
    i +=1;
    sprops.put("Incrementer", i);
  } catch (JSONException e){

Related post: Incremental super properties

Did this answer your question?



Article is closed for comments.