Package 

Class TDAnalyticsAPI


  • 
    public class TDAnalyticsAPI
    
                        

    The packaging class of multi ThinkingAnalyticsSDK instance provides static methods, which is more convenient for customers to use

    • 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 uploaded
        appId - app id
      • 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 name
        appId - app id
      • track

         static void track(String eventName, JSONObject properties, String appId)

        Upload events and their associated attributes.

        Parameters:
        eventName - event name
        properties - event properties
        appId - 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 name
        properties - event properties
        time - event time
        timeZone - event timeZone
        appId - app id
      • track

         static void track(TDEventModel eventModel, String appId)

        Upload a special type of event.

        Parameters:
        eventModel - Event Object TDFirstEventModel / TDOverWritableEventModel / TDUpdatableEventModel
        appId - 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 enabled
        appId - 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 enabled
        properties - properties
        appId - 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 enabled
        eventHandler - callback
        appId - 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 name
        appId - 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 property
        appId - 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 property
        appId - 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 property
        appId - app id
      • userAppend

         static void userAppend(JSONObject properties, String appId)

        Append a user attribute of the List type.

        Parameters:
        properties - user property
        appId - 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 property
        appId - 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 properties
        appId - app id
      • unsetSuperProperty

         static void unsetSuperProperty(String superPropertyName, String appId)

        Clears a public event attribute.

        Parameters:
        superPropertyName - Public event attribute key to clear
        appId - app id
      • clearSuperProperties

         static void clearSuperProperties(String appId)

        Clear all public event attributes.

        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 id
        appId - 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 id
        appId - app id
      • getDistinctId

         static String getDistinctId(String appId)

        Get a visitor ID: The #distinct_id value in the reported data.

        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
      • enableThirdPartySharing

         static void enableThirdPartySharing(int types, String appId)

        Enable three-party data synchronization.

        Parameters:
        types - third types
        appId - app id
      • enableThirdPartySharing

         static void enableThirdPartySharing(int type, Object obj, String appId)

        Enable three-party data synchronization.

        Parameters:
        type - third types
        obj - extras
        appId - app id
      • trackViewScreen

         static void trackViewScreen(Activity activity, String appId)

        Manually trigger the page browsing event upload.

        Parameters:
        activity - activity
        appId - 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 collected
        appId - 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 type
        appId - 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 activity
        appId - 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 activity
        appId - 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 - widget
        viewID - widget ID
        appId - 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 view
        viewID - widget ID
        appId - 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 properties
        properties - properties
        appId - app id
      • ignoreView

         static void ignoreView(View view, String appId)

        Ignores control click events of the specified view.

        Parameters:
        view - widget
        appId - 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 instance
        appId - app id
      • setJsBridgeForX5WebView

         static void setJsBridgeForX5WebView(Object x5WebView, String appId)

        Tencent X5 WebView gets through with native APP SDK.

        Parameters:
        x5WebView - WebView instance
        appId - app id