-
public class TDAnalyticsAPIThe packaging class of multi ThinkingAnalyticsSDK instance provides static methods, which is more convenient for customers to use
-
-
Method Summary
Modifier and Type Method Description static voidsetNetworkType(TDAnalytics.TDNetworkType networkType, String appId)Set the network conditions for uploading. static voidregisterErrorCallback(TDAnalytics.TDSendDataErrorCallback callback, String appId)static StringlightInstance(String appId)Create lightweight SDK instances. static voidtrack(String eventName, String appId)Upload a single event, containing only preset properties and set public properties. static voidtrack(String eventName, JSONObject properties, String appId)Upload events and their associated attributes. static voidtrack(String eventName, JSONObject properties, Date time, TimeZone timeZone, String appId)Upload the event and set the event trigger time. static voidtrack(TDEventModel eventModel, String appId)Upload a special type of event. static voidenableAutoTrack(int autoTrackEventType, String appId)Enable the auto tracking function. static voidenableAutoTrack(int autoTrackEventType, JSONObject properties, String appId)Enable the auto tracking function with properties static voidenableAutoTrack(int autoTrackEventType, TDAnalytics.TDAutoTrackEventHandler eventHandler, String appId)Enable the auto tracking function with properties static voidtimeEvent(String eventName, String appId)Record the event duration, call this method to start the timing, stop the timing when the target event is uploaded, and add the attribute #duration to the event properties, in seconds. static voiduserSet(JSONObject properties, String appId)Sets the user property, replacing the original value with the new value if the property already exists. static voiduserSetOnce(JSONObject properties, String appId)Sets a single user attribute, ignoring the new attribute value if the attribute already exists. static voiduserUnset(Array<String> properties)Reset user properties. static voiduserAdd(JSONObject properties, String appId)Only one attribute is set when the user attributes of a numeric type are added. static voiduserAppend(JSONObject properties, String appId)Append a user attribute of the List type. static voiduserUniqAppend(JSONObject properties, String appId)The element appended to the library needs to be done to remove the processing, remove the support, and then import. static voiduserDelete(String appId)Delete the user attributes, but retain the uploaded event data. static voidsetSuperProperties(JSONObject superProperties, String appId)Set the public event attribute, which will be included in every event uploaded after that. static voidsetDynamicSuperProperties(TDAnalytics.TDDynamicSuperPropertiesHandler dynamicSuperPropertiesTracker, String appId)Set dynamic public properties. static voidunsetSuperProperty(String superPropertyName, String appId)Clears a public event attribute. static voidclearSuperProperties(String appId)Clear all public event attributes. static JSONObjectgetSuperProperties(String appId)Gets the public event properties that have been set. static TDPresetPropertiesgetPresetProperties(String appId)Gets prefabricated properties for all events. static voidlogin(String loginId, String appId)Set the account ID. static voidlogout(String appId)Clearing the account ID will not upload user logout events. static voidsetDistinctId(String identity, String appId)Set the distinct ID to replace the default UUID distinct ID. static StringgetDistinctId(String appId)Get a visitor ID: The #distinct_id value in the reported data. static StringgetAccountId(String appId)static StringgetDeviceId(String appId)Obtain the device ID. static voidflush(String appId)Empty the cache queue. static voidsetTrackStatus(TDAnalytics.TDTrackStatus status, String appId)The switch reporting status is suspended and restored. static voidenableThirdPartySharing(int types, String appId)Enable three-party data synchronization. static voidenableThirdPartySharing(int type, Object obj, String appId)Enable three-party data synchronization. static voidignoreAppViewEventInExtPackage(String appId)Ignore automatic collection events in the extension pack static voidtrackViewScreen(Activity activity, String appId)Manually trigger the page browsing event upload. static voidtrackViewScreen(Fragment fragment, String appId)Manually trigger the page browsing event upload. static voidtrackViewScreen(Object fragment, String appId)Manually trigger the page browsing event upload. static voidignoreViewType(Class<out Object> viewType, String appId)Ignores control click events of the specified type. static voidtrackFragmentAppViewScreen(String appId)Enable the automatic collection Fragment browsing event. static voidignoreAutoTrackActivity(Class<out Object> activity, String appId)Ignore automatic collection events for multiple pages, including page browsing and control clicks. static voidignoreAutoTrackActivities(List<Class<out Object>> activitiesList, String appId)Ignore automatic collection events for multiple pages, including page browsing and control clicks. static voidsetViewID(View view, String viewID, String appId)Custom control ID. static voidsetViewID(Dialog view, String viewID, String appId)Custom control ID. static voidsetViewProperties(View view, JSONObject properties, String appId)Customize the properties of the control click event. static voidignoreView(View view, String appId)Ignores control click events of the specified view. static voidsetJsBridge(WebView webView, String appId)Support H5 to connect with native APP SDK.This function is called when the WebView is initialized. static voidsetJsBridgeForX5WebView(Object x5WebView, String appId)Tencent X5 WebView gets through with native APP SDK. static ThinkingAnalyticsSDKgetInstance(String appId)-
-
Method Detail
-
setNetworkType
static void setNetworkType(TDAnalytics.TDNetworkType networkType, String appId)
Set the network conditions for uploading. By default, the SDK will upload data on 3G, 4G and Wifi.
- Parameters:
networkType- Type of the network on which data is uploadedappId- app id
-
registerErrorCallback
static void registerErrorCallback(TDAnalytics.TDSendDataErrorCallback callback, String appId)
-
lightInstance
static String lightInstance(String appId)
Create lightweight SDK instances. Lightweight SDK instances do not supportcaching of local account ids, guest ids, public properties, etc.
- Parameters:
appId- app id
-
track
static void track(String eventName, String appId)
Upload a single event, containing only preset properties and set public properties.
- Parameters:
eventName- event nameappId- app id
-
track
static void track(String eventName, JSONObject properties, String appId)
Upload events and their associated attributes.
- Parameters:
eventName- event nameproperties- event propertiesappId- app id
-
track
static void track(String eventName, JSONObject properties, Date time, TimeZone timeZone, String appId)
Upload the event and set the event trigger time. SDK v2.2.0 support is available.
- Parameters:
eventName- event nameproperties- event propertiestime- event timetimeZone- event timeZoneappId- app id
-
track
static void track(TDEventModel eventModel, String appId)
Upload a special type of event.
- Parameters:
eventModel- Event Object TDFirstEventModel / TDOverWritableEventModel / TDUpdatableEventModelappId- app id
-
enableAutoTrack
static void enableAutoTrack(int autoTrackEventType, String appId)
Enable the auto tracking function.
- Parameters:
autoTrackEventType- Indicates the type of the automatic collection event to be enabledappId- app id
-
enableAutoTrack
static void enableAutoTrack(int autoTrackEventType, JSONObject properties, String appId)
Enable the auto tracking function with properties
- Parameters:
autoTrackEventType- Indicates the type of the automatic collection event to be enabledproperties- propertiesappId- app id
-
enableAutoTrack
static void enableAutoTrack(int autoTrackEventType, TDAnalytics.TDAutoTrackEventHandler eventHandler, String appId)
Enable the auto tracking function with properties
- Parameters:
autoTrackEventType- Indicates the type of the automatic collection event to be enabledeventHandler- callbackappId- app id
-
timeEvent
static void timeEvent(String eventName, String appId)
Record the event duration, call this method to start the timing, stop the timing when the target event is uploaded, and add the attribute #duration to the event properties, in seconds.
- Parameters:
eventName- target event nameappId- app id
-
userSet
static void userSet(JSONObject properties, String appId)
Sets the user property, replacing the original value with the new value if the property already exists.
- Parameters:
properties- user propertyappId- app id
-
userSetOnce
static void userSetOnce(JSONObject properties, String appId)
Sets a single user attribute, ignoring the new attribute value if the attribute already exists.
- Parameters:
properties- user propertyappId- app id
-
userUnset
static void userUnset(Array<String> properties)
Reset user properties.
- Parameters:
properties- user property and last is app id
-
userAdd
static void userAdd(JSONObject properties, String appId)
Only one attribute is set when the user attributes of a numeric type are added.
- Parameters:
properties- user propertyappId- app id
-
userAppend
static void userAppend(JSONObject properties, String appId)
Append a user attribute of the List type.
- Parameters:
properties- user propertyappId- app id
-
userUniqAppend
static void userUniqAppend(JSONObject properties, String appId)
The element appended to the library needs to be done to remove the processing, remove the support, and then import.
- Parameters:
properties- user propertyappId- app id
-
userDelete
static void userDelete(String appId)
Delete the user attributes, but retain the uploaded event data. This operation is not reversible and should be performed with caution.
- Parameters:
appId- app id
-
setSuperProperties
static void setSuperProperties(JSONObject superProperties, String appId)
Set the public event attribute, which will be included in every event uploaded after that. The public event properties are saved without setting them each time.
- Parameters:
superProperties- super propertiesappId- app id
-
setDynamicSuperProperties
static void setDynamicSuperProperties(TDAnalytics.TDDynamicSuperPropertiesHandler dynamicSuperPropertiesTracker, String appId)
Set dynamic public properties. Each event uploaded after that will contain a public event attribute.
- Parameters:
dynamicSuperPropertiesTracker- Dynamic public attribute interfaceappId- app id
-
unsetSuperProperty
static void unsetSuperProperty(String superPropertyName, String appId)
Clears a public event attribute.
- Parameters:
superPropertyName- Public event attribute key to clearappId- app id
-
clearSuperProperties
static void clearSuperProperties(String appId)
Clear all public event attributes.
- Parameters:
appId- app id
-
getSuperProperties
static JSONObject getSuperProperties(String appId)
Gets the public event properties that have been set.
- Parameters:
appId- app id
-
getPresetProperties
static TDPresetProperties getPresetProperties(String appId)
Gets prefabricated properties for all events.
- Parameters:
appId- app id
-
login
static void login(String loginId, String appId)
Set the account ID. Each setting overrides the previous value. Login events will not be uploaded.
- Parameters:
loginId- account idappId- app id
-
logout
static void logout(String appId)
Clearing the account ID will not upload user logout events.
- Parameters:
appId- app id
-
setDistinctId
static void setDistinctId(String identity, String appId)
Set the distinct ID to replace the default UUID distinct ID.
- Parameters:
identity- distinct idappId- app id
-
getDistinctId
static String getDistinctId(String appId)
Get a visitor ID: The #distinct_id value in the reported data.
- Parameters:
appId- app id
-
getAccountId
static String getAccountId(String appId)
-
getDeviceId
static String getDeviceId(String appId)
Obtain the device ID.
- Parameters:
appId- app id
-
flush
static void flush(String appId)
Empty the cache queue. When this function is called, the data in the current cache queue will attempt to be reported.If the report succeeds, local cache data will be deleted.
- Parameters:
appId- app id
-
setTrackStatus
static void setTrackStatus(TDAnalytics.TDTrackStatus status, String appId)
The switch reporting status is suspended and restored.
- Parameters:
status- TDTrackStatusappId- app id
-
enableThirdPartySharing
static void enableThirdPartySharing(int types, String appId)
Enable three-party data synchronization.
- Parameters:
types- third typesappId- app id
-
enableThirdPartySharing
static void enableThirdPartySharing(int type, Object obj, String appId)
Enable three-party data synchronization.
- Parameters:
type- third typesobj- extrasappId- app id
-
ignoreAppViewEventInExtPackage
static void ignoreAppViewEventInExtPackage(String appId)
Ignore automatic collection events in the extension pack
- Parameters:
appId- app id
-
trackViewScreen
static void trackViewScreen(Activity activity, String appId)
Manually trigger the page browsing event upload.
- Parameters:
activity- activityappId- app id
-
trackViewScreen
static void trackViewScreen(Fragment fragment, String appId)
Manually trigger the page browsing event upload.
- Parameters:
fragment- Indicates the Fragment instance to be collectedappId- app id
-
trackViewScreen
static void trackViewScreen(Object fragment, String appId)
Manually trigger the page browsing event upload.
- Parameters:
fragment- Indicates the Fragment instance to be collected.appId- app id
-
ignoreViewType
static void ignoreViewType(Class<out Object> viewType, String appId)
Ignores control click events of the specified type.
- Parameters:
viewType- view typeappId- app id
-
trackFragmentAppViewScreen
static void trackFragmentAppViewScreen(String appId)
Enable the automatic collection Fragment browsing event.
- Parameters:
appId- app id
-
ignoreAutoTrackActivity
static void ignoreAutoTrackActivity(Class<out Object> activity, String appId)
Ignore automatic collection events for multiple pages, including page browsing and control clicks.
- Parameters:
activity- single activityappId- app id
-
ignoreAutoTrackActivities
static void ignoreAutoTrackActivities(List<Class<out Object>> activitiesList, String appId)
Ignore automatic collection events for multiple pages, including page browsing and control clicks.
- Parameters:
activitiesList- list of activityappId- app id
-
setViewID
static void setViewID(View view, String viewID, String appId)
Custom control ID. If this parameter is not specified, android:id is used by default.
- Parameters:
view- widgetviewID- widget IDappId- app id
-
setViewID
static void setViewID(Dialog view, String viewID, String appId)
Custom control ID. If this parameter is not specified, android:id is used by default.
- Parameters:
view- dialog viewviewID- widget IDappId- app id
-
setViewProperties
static void setViewProperties(View view, JSONObject properties, String appId)
Customize the properties of the control click event.
- Parameters:
view- Control that you want to set custom propertiesproperties- propertiesappId- app id
-
ignoreView
static void ignoreView(View view, String appId)
Ignores control click events of the specified view.
- Parameters:
view- widgetappId- app id
-
setJsBridge
static void setJsBridge(WebView webView, String appId)
Support H5 to connect with native APP SDK.This function is called when the WebView is initialized.
- Parameters:
webView- WebView instanceappId- app id
-
setJsBridgeForX5WebView
static void setJsBridgeForX5WebView(Object x5WebView, String appId)
Tencent X5 WebView gets through with native APP SDK.
- Parameters:
x5WebView- WebView instanceappId- app id
-
getInstance
static ThinkingAnalyticsSDK getInstance(String appId)
-
-
-
-