Menu

Set Public Event Properties

       Public event properties refer to the properties that are included in every event, such as the user's source channel and the advertising ID associated with conversions.

       It is recommended to set the public event properties before the SDK initialization. This ensures that the predefined public event properties are included in all reported events.

1. Set Public Event Properties

       The method for setting public event properties supports various data types, including int, long, float, double, boolean, string, as well as JSONArray and JSONObject. Here's an example of setting a value of type String.

Function

public void setSuperProperties(Context context, String key, String value);
ParameterDescriptionTypeRequired
contextThe context of the applicationContextYes
keyThe "key" of the public event propertyStringYes
valueThe "value" of the public event propertyStringYes

Sample Code

import com.reyun.solar.engine.SolarEngineManager;
SolarEngineManager.getInstance().setSuperProperties(context,"key","value");


Note:

  • Public event properties will be saved in the cache and do not need to be called every time the app is started.
  • Uploading previously set public properties again by calling 'setSuperProperties' will overwrite the previous properties.
  • If a key in the public event properties overlaps with a property uploaded in an event report, the property in the specific event will override the corresponding public event property.
  • Please do not set public event properties with a key starting with an underscore "_". The SE SDK will abandon properties like this.

2. Delete Defined Public Event Properties

Function

public void unsetSuperProperty(Context context,String key);
ParameterDescriptionTypeRequired
contextThe context of the applicationContextYes
keyThe "key" of the public event property StringYes

Sample Code

import com.reyun.solar.engine.SolarEngineManager;
SolarEngineManager.getInstance().unsetSuperProperty(context,"xxxkey value needs clearingxxx");

3. Delete All Public Event Properties

Function

public void clearSuperProperties(Context context);
ParameterDescriptionTypeRequired
contextThe context of the applicationContextYes

Sample Code

import com.reyun.solar.engine.SolarEngineManager;
SolarEngineManager.getInstance().clearSuperProperties(context);


Previous
Set Account ID
Next
Get Preset Properties
Last modified: 2024-12-03Powered by