Menu

Automatic collection

The heat engine SDK supports automatic collection of click and page browsing events.

How to enable automatic collection:

  1. By setting it when the heat engine SDK is initialized.
  2. After initialization, reopen or close via API


1. Android SDK turns on automatic collection

1.1 Initialize code configuration to enable automatic collection

List<AutoTrackEventType> autoTrackEventTypeList = new ArrayList<>(); 
autoTrackEventTypeList.add(AutoTrackEventType.AutoTrackAppViewScreen); 
autoTrackEventTypeList.add(AutoTrackEventType.AutotrackAppClick); 

SolarEngineConfig config = new SolarEngineConfig.Builder() 
.enableAutoTrackEvent(autoTrackEventTypeList) //自动采集方法入口 
.build();

1.2 Introduction to automatic collection and enumeration

parameter name Parameter meaning
AutoTrackEventType.AutoTrackAppViewScreen Automatically collect page browsing events
AutoTrackEventType.AutotrackAppClick Automatically collect click events
  • The developer did not call the enableAutoTrackEvent(List autoTrackEventTypeList) method during initialization, and the SDK turned off automatic collection by default.
  • Developers call the enableAutoTrackEvent(List autoTrackEventTypeList) method during initialization.
    • Only pass in AutoTrackEventType.AutoTrackAppViewScreen, and the SDK will automatically collect page browsing events.
    • Only pass in AutoTrackEventType.AutotrackAppClick, and the SDK will automatically collect click events.
    • Both are passed in at the same time, and the SDK automatically collects page browsing and click events.

1.3 Turn on automatic collection

Method example

public void enableAutoTrack();

Call example

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().enableAutoTrack();

1.4 Turn off automatic collection

Method example

public void disableAutoTrack();

Call example

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().disableAutoTrack();

1.5 Turn on automatic collection of click events

Method example

public void enableAutoTrackAppClick();

Call example

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().enableAutoTrackAppClick();

1.6 Turn off automatic collection of click events

Method example

public void disableAutoTrackAppClick();

Call example

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().disableAutoTrackAppClick();

1.7 Turn on automatic collection of page browsing events

Method example

public void enableAutoTrackApViewScreen();

Call the sample code:

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().enableAutoTrackApViewScreen();

1.8 Turn off automatic collection of page browsing events

Method example

public void disableAutoTrackApViewScreen();

Call example

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().disableAutoTrackApViewScreen();

1.9 Ignore automatic collection under a single Activity

Method example

public void ignoreAutoTrackActivity(Class<?> ignoredActivity);

Parameter related

parameter name Parameter meaning Parameter Type Is it mandatory?
ignoredActivity Specify activities to ignore Class<?> yes

Call example

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().ignoreAutoTrackActivity(MainActivity.class);

In addition to the above api, developers can also ignore automatic collection under a single Activity by adding the annotation @SolarEngineIgnoreTrackAppViewScreenAndAppClick to the Activity

Call the sample code:

import com.reyun.solar.engine.autotrack.SolarEngineIgnoreTrackAppViewScreenAndAppClick;

@SolarEngineIgnoreTrackAppViewScreenAndAppClick
public class MainActivity extends Activity {
        
}

1.10 Restore automatic collection under a single Activity

Method example

public void restoreAutoTrackActivity(Class<?> restoredActivity);

Parameter related

parameter name Parameter meaning Parameter Type Is it mandatory?
restoredActivity Specify the activity to be restored Class<?> yes

Call example

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().restoreAutoTrackActivity(MainActivity.class);

1.11 Ignore automatic collection under multiple activities

Method example

public void ignoreAutoTrackActivities(List<Class<?>> ignoredActivities);

Parameter related

parameter name Parameter meaning Parameter Type Is it mandatory?
ignoredActivities Specify the collection of activities to ignore List> yes

Call example

import com.reyun.solar.engine.SolarEngineManager;

List<Class<?>>  classList = new ArrayList<>();
classList.add(MainActivity.class);
classList.add(LoginActivity.class);
SolarEngineManager.getInstance().ignoreAutoTrackActivities(classList);

1.12 Restore automatic collection under multiple activities

Method example

 !#twenty one@!

Parameter related

parameter name Parameter meaning Parameter Type Is it mandatory?
restoredActivities Specify the restored Activity collection Class<?> yes

Call example

 !#twenty two@!

1.13 Ignore clicks on controls of specified types

Method example

 !#twenty three@!

Parameter related

parameter name Parameter meaning Parameter Type Is it mandatory?
ignoredViewType Specify control types to ignore Class yes

Call example

 !#twenty four@!

1.14 Restore the click of the specified type of control

Method example

public void restoreViewType(Class restoredViewType);

Parameter related

parameter name Parameter meaning Parameter Type Is it mandatory?
restoredViewType Specify the type of control to restore Class yes

Call example

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().restoreViewType(Button.class);

1.15 Set id for the specified View

Method example

public void setViewId(View view, String viewId);

Parameter related:

parameter name Parameter meaning Parameter Type Is it mandatory?
view View that needs to set id attribute View yes
viewId Set control ID String yes

Call example

import com.reyun.solar.engine.SolarEngineManager;

SolarEngineManager.getInstance().setViewId(customBtn, viewId);

1.16 Set custom properties for the specified View

Method example

public void setViewProperties(View view, JSONObject customProperties);

Parameter related

parameter name Parameter meaning Parameter Type Is it mandatory?
view View that needs to set id attribute View yes
customProperties View custom attributes JSONObject yes

Call example

import com.reyun.solar.engine.SolarEngineManager;
import org.json.JSONObject;

JSONObject customProperties = new JSONObject();
try {
    //开发者自定义Json格式事件属性
    customProperties.put("view_key1","view_value1");
    customProperties.put("view_key2","view_value2");
} catch (JSONException e) {
    ///
}

SolarEngineManager.getInstance().setViewProperties(customBtn, customProperties);

1.17 Set Ur and custom attributes for Activity page

Call example

import com.reyun.solar.engine.autotrack.SolarEngineScreenAutoTrack;

public class MainActivity extends Activity implements SolarEngineScreenAutoTrack {
     @Override
    public String getScreenUrl() {
        return "solarengine://page/inappevent";
    }

    @Override
    public JSONObject getScreenAutoTrackProperties() throws JSONException {
        JSONObject customProperties = new JSONObject();
        customProperties.put("key1", "value1");
        customProperties.put("key2", "value2");
        return customProperties;
    }
}

If the auto-collection feature is used and obfuscation configuration is required during packaging, please add the following code to the obfuscation configuration file.

# TabLayout
-keep class android.support.design.widget.TabLayout$Tab {*;}
-keep class com.google.android.material.tabs.TabLayout$Tab {*;}
-keep class * extends android.support.design.widget.TabLayout$Tab {*;}
-keep class * extends com.google.android.material.tabs.TabLayout$Tab {*;}


# SwitchCompat
-keep class android.support.v7.widget.SwitchCompat {*;}
-keep class androidx.appcompat.widget.SwitchCompat {*;}
-keep class * extends android.support.v7.widget.SwitchCompat {*;}
-keep class * extends androidx.appcompat.widget.SwitchCompat {*;}

# ContextCompat
-keep class android.support.v4.content.ContextCompat {*;}
-keep class androidx.core.content.ContextCompat {*;}
-keep class * extends android.support.v4.content.ContextCompat {*;}
-keep class * extends androidx.core.content.ContextCompat {*;}

#ActionBar
-keep class android.support.v7.app.ActionBar {*;}
-keep class androidx.appcompat.app.ActionBar {*;}
-keep class * extends android.support.v7.app.ActionBar {*;}
-keep class * extends androidx.appcompat.app.ActionBar {*;}

# AppCompatActivity
-keep class android.support.v7.app.AppCompatActivity {
    public android.support.v7.app.ActionBar getSupportActionBar();
}
-keep class androidx.appcompat.app.AppCompatActivity {
    public androidx.appcompat.app.ActionBar getSupportActionBar();
}
-keep class * extends android.support.v7.app.AppCompatActivity {
    public android.support.v7.app.ActionBar getSupportActionBar();
}
-keep class * extends androidx.appcompat.app.AppCompatActivity {
    public androidx.appcompat.app.ActionBar getSupportActionBar();
}

# Annotation
-keepattributes *Annotation*
-keepattributes *JavascriptInterface*

2. iOS SDK turns on automatic collection

2.1 Manually report page browsing events

The _event_name of the page view event is _appViewScreen

Method example:

- (void)trackAppViewScreen:(UIViewController *)viewController withProperties:(NSDictionary *)properties;

Parameter related:

parameter name Parameter meaning Parameter Type Is it mandatory?
viewController The viewController to which the current page belongs UIViewController yes
properties For descriptions of custom attributes passed in by developers, see the directory: 4. Custom Attributes NSDictionary no

Call the sample code:

#import <SolarEngineSDK/SolarEngineSDK.h>

UIViewController *vc = self;
[[SolarEngineSDK sharedInstance] trackAppViewScreen:vc withProperties:@{@"custom_name":@"ActionViewController"}];

2.2 Manually report control click events

The _event_name of the control click event is _applicationClick

The type of control click supports the following common control views or custom type views, such as: UIView, UIButton, UITextView, UIPickerView, UIDatePicker, UISegmentedControl, UISwitch, UISlider, UIStepper, etc.

Method example:

- (void)trackAppClick:(UIView *)view withProperties:(NSDictionary *)properties;

Parameter related:

parameter name Parameter meaning Parameter Type Is it mandatory?
view Clicked view element UIView yes
properties For descriptions of custom attributes passed in by developers, see the directory: 4. Custom Attributes NSDictionary no

Call the sample code:

#import <SolarEngineSDK/SolarEngineSDK.h>

UIButton *button = self.button;
[[SolarEngineSDK sharedInstance] trackAppClick: button withProperties:@{@"custom_name":@"UIButton"}];

2.3 Automatic buried point collection

The SDK has its own automatic point collection function. The automatic point collection function is turned off by default. After it is turned on, the SDK will automatically collect "page browsing" and "control clicks" in the App.

The _event_name of the page view event is _appViewScreen

The _event_name of the control click event is _applicationClick

Note: After the automatic point collection of a page or control is turned on, the manual point collection API call of the corresponding page or control will be invalid.

2.4 Turn on automatic point collection

The SDK provides two ways to enable automatic collection

1. Turn on automatic tracking when initializing the SDK

2. Call automatic tracking API

After the automatic tracking function is turned on, you can turn it off at any time. After turning it off, the SDK will no longer generate automatically collected tracking events.

Enable automatic tracking when initializing the SDK, sample code

    SEConfig *config = [[SEConfig alloc] init];
    config.autoTrackEventType = SEAutoTrackEventTypeAppClick | SEAutoTrackEventTypeAppViewScreen;
    [[SolarEngineSDK sharedInstance] startWithAppKey:your_appKey userId:your_userId_SolarEngine config:config];

Call automatic tracking API, sample code

// 开启自动追踪控件点击 和 页面浏览
[[SolarEngineSDK sharedInstance] setAutoTrackEventType:SEAutoTrackEventTypeAppClick | SEAutoTrackEventTypeAppViewScreen];

// 只开启自动追踪控件点击
[[SolarEngineSDK sharedInstance] setAutoTrackEventType:SEAutoTrackEventTypeAppClick];

Turn off automatic tracking, sample code

// 关闭自动追踪
[[SolarEngineSDK sharedInstance] setAutoTrackEventType:SEAutoTrackEventTypeNone];

2.5 Ignore automatic tracking of a certain page

The SDK adds an attribute se_ignoreAutoTrack to the Category of UIViewController to set whether to ignore the current page and whether to ignore automatic collection.

After ignoring it, the page will no longer generate the automatic buried event "appViewScreen"

After the page ignores automatic buried point collection, the automatic buried point collection of all controls in the page will also be ignored.

Note: Ignored pages or controls can support manual call for buried point collection.

Sample code


- (void)viewDidLoad {
    [super viewDidLoad];

 // 忽略当前 ViewController 自动追踪
    self.se_ignoreAutoTrack = YES;
}

2.6 Ignore certain types of controls and automatically bury point collection

The SDK supports ignoring the automatic point collection of certain types of controls. After ignoring it, this type of control will no longer generate the automatic point collection event "_applicationClick".

Note: Ignored pages or controls can support manual call for buried point collection.

Ignore certain types of control APIs

/// 忽略某类控件自送追踪
/// @param classList 需要忽略控件的类名,例如:  @[[UIButton class]]
- (void)ignoreAutoTrackAppClickClassList:(NSArray<Class> *)classList;


Sample code

// 忽略UIButton类型的自动埋点采集
[[SolarEngineSDK sharedInstance] ignoreAutoTrackAppClickClassList:@[[UIButton class]];

2.7 Add custom attributes

The SDK supports adding custom attributes to pages or controls. When an automatic collection and buried event of the corresponding page or control is generated, the custom attributes will be brought along.

The SDK adds se_customProperties custom properties to UIViewController and UIView through Category.

Add custom attribute API


@interface UIView (SolarEngine)

/// 自定义属性,设置自定义属性后会跟随控件点击自动追踪事件一起上报
@property (nonatomic, copy) NSDictionary *se_customProperties;

@end

@interface UIViewController (SolarEngine)

/// 自定义属性,设置自定义属性后会跟随页面浏览自动追踪事件一起上报
@property (nonatomic, copy) NSDictionary *se_customProperties;

@end

Sample code


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"CellID"];
    // 给Cell设置自定义属性,cell点击时产生的自动埋点采集将带着该自定义属性
    cell.se_customProperties = @{@"key1":@"value1"};
    return cell;
}

2.8 Set custom ScreenUrl

The SDK can set the ScreenUrl for the current page. When the next page is automatically collected, the _referrer_name field will be the custom ScreenUrl just set.

Sample code

#import <SolarEngineSDK/SolarEngineSDK.h>


@interface ViewController ()<SEScreenAutoTracker>


- (NSString *)getScreenUrl {
    return @"custom_screenUrl";
}

3. Web SDK enables automatic collection

3.1 Manually report page browsing events

SESDK.trackPageView();

3.2 Manually report page element click events

SESDK.trackPageClick(element); 

// element 点击行为的元素对象
element对象上可绑定如下data属性

data-element-id  自定义id属性,如果没有配置时会自动抓取点击行为的元素对象元素的id属性。以_element_id进行上报。
data-element-target-url 当前点击行为发生跳转时的目标url, 如果没有配置时且当前点击行为的元素是a标签,那么会自动抓取a标签的href属性。以_element_target_url进行上报。

Note: The SDK will also automatically capture the following attributes of the element object of the click behavior:

1. The name attribute on the element is reported as _element_name

2. The class attribute on the element is reported as _element_class_name

3. Element text content is reported as _element_content

4. Element tag, reported with _element_type


3.3 Automatic buried point collection

The SDK supports the automatic point collection function. By default, the automatic point collection function is turned off. After it is turned on, the SDK will automatically collect "browse" and "click" in the web page, corresponding to the above 3.1 page browsing event and 3.2 page click event.

The _event_name of the page view event is _webViewScreen

The _event_name of the element click event is _webElementClick

Note: After the automatic point collection of a page or element is turned on, the manual point collection API call of the corresponding page or element will automatically complete the collection .


3.4 Turn on automatic buried point collection

The SDK provides two ways to enable automatic collection

  1. Enable automatic tracking when initializing the SDK
  2. Call automatic tracking API

After the automatic tracking function is turned on, it can be turned off at any time. After turning it off, the SDK will no longer generate automatically collected tracking events.

Enable automatic tracking when initializing the SDK, sample code (see the SDK initialization section at the beginning of the document for parameter meanings)

SESDK.init({
  config: {
    autoTrackConfig: {
      autoTrack: true,
      autoTrackPageView: true,
      autoTrackPageClick: true,
      isTrackSinglePage: true,
    }
  }
})


Automatic buried point acquisition configuration AutoTrackConfig parameter description:

parameter type Is it required? illustrate
autoTrack boolean no Whether to enable automatic point collection for page browsing and clicks. The default is false and is not enabled.
autoTrackPageView boolean no Whether to enable automatic point collection for page browsing. The default is false. If automatic point collection is enabled, manual calling of the page browsing API is prohibited.
autoTrackPageClick boolean no Whether to enable automatic tracking collection of clicks on page elements. The default is false. If automatic collection is enabled, manual calling of the page element click API is prohibited. Note: If automatic tracking collection of clicks on page elements is enabled, the click event callback of the element cannot be set. Prevent the click event from bubbling up.
isTrackSinglePage boolean no Whether to enable automatic point collection for page browsing in single-page applications. Default is true.


Call automatic tracking API, sample code

// 开启自动追踪元素点击 和 页面浏览
// 方式一
SESDK.setAutoTrack({
  autoTrack: true
});
// 方式二
SESDK.setAutoTrack({
  autoTrackPageView: true,
  autoTrackPageClick: true,
});

// 只开启自动追踪元素点击
SESDK.setAutoTrack({
  autoTrackPageClick: true,
});


Turn off automatic tracking, sample code

// 关闭自动追踪
// 方式一
SESDK.setAutoTrack({
  autoTrack: false
});
// 方式二
SESDK.setAutoTrack({
  autoTrackPageView: false,
  autoTrackPageClick: false,
});


3.5 Ignore automatic tracking of a certain page

The SDK provides setTrackPageView to set whether to ignore the automatic collection of the current page; and to add custom attributes to the page. When an automatic tracking event on the page occurs, the custom attributes will be brought along.

After ignoring it, the page will no longer generate the automatic burying event "_webViewScreen"


After the page ignores automatic click collection, the automatic click collection of all elements in the page will also be ignored.

Note: Ignored pages or elements can support manual call for buried point collection.

Sample code

SESDK.setTrackPageView(Array<{
  path: trackConfig
}>)

path: the path of the current page (the url of the page)

trackConfig parameter description:

parameter name Parameter meaning Parameter Type Is it mandatory?
ignoreTrack Whether to ignore the automatic reporting of browsing behavior corresponding to the path, the default is false. If true, all click behaviors under the corresponding path will also be ignored and automatically reported. boolean no
customProperty Custom attributes when the browsing behavior corresponding to the path is automatically reported object (for specific requirements, see Event Reporting-Custom Attribute Requirements) no

Call example:

SESDK.setTrackPageView([
  {
    'https://portal.solar-engine.com/all/product/dashboard': {
      ignoreTrack: false,
      customProperty: {
        a: 1,
        b: 2
      }
    }
  }
])

3.6 Ignore a certain element and automatically bury point collection

The SDK supports ignoring the automatic tracking collection of a certain element. After ignoring it, the element will no longer generate the automatic tracking collection event "_webElementClick".

Note: Ignored elements can support manual call for buried point collection.


To ignore an element, bind the attribute data-ignore-track="true" to the element. After being ignored, the element can call the "element click event" method in 6.2

<div data-ignore-track="true">我是按钮</div>

Note:

If event information is reported when the page is closed, the reporting request may fail. For example, when clicking a button triggers a page jump (not a single-page application jump), the information on the page before the jump may fail to be reported. At this time, when the automatic point collection of element clicks is turned on, it is recommended to ignore the automatic point collection of the current button and use manual calling to report the data.

// 元素点击事件的回调方法
function clickHandler() {
   // 手动上报点击行为事件
   SESDK.trackPageClick(element);
   //延迟跳转页面,给 SDK 发送数据提供时间
   setTimeout(function(){
     window.location.href = url; 
   },500);
}


3.7 Add custom attributes to elements

The SDK supports adding custom attributes to elements. When an automatic collection and buried event of the corresponding element is generated, the custom attributes will be brought along.

The SDK adds custom attributes to the element by binding the attribute data-custom-property on the element. For specific requirements on the custom attribute format, see Event Reporting - Custom Attribute Requirements).

<div data-custom-property="{a: 1, b: 2}">我是按钮</div>


4. Mini Program SDK turns on automatic collection

4.1 Manually report page browsing events

SESDK.trackPageView();

4.2 Manually report page element click events

SESDK.trackPageClick(event); 

// event 点击行为的event对象
点击的元素上可绑定如下data属性

data-element-id  自定义id属性,没有配置时会去元素的id。以_element_id进行上报。
data-content   元素自定义内容。以_element_content进行上报。
data-name 元素自定义name属性。以_element_name进行上报。
data-class-name  元素class属性。以_element_class_name进行上报。
data-type 元素类型-控件的类型,例如 Button。以_element_type进行上报。
data-element-target-url 当前点击行为发生跳转时的目标url。以_element_target_url进行上报。


4.3 Automatic buried point collection

The SDK supports the automatic point collection function. The automatic point collection function is turned off by default. After it is turned on, the SDK will automatically collect the "browse" and "click" in the mini program page, corresponding to the above 4.1 page browsing event and 4.2 page click. event

The _event_name of the page view event is _mpViewScreen

The _event_name of the element click event is _mpElementClick

Note: After the automatic point collection of a page or element is turned on, the manual point collection API call of the corresponding page or element will be invalid.


4.4 Turn on automatic point collection

The SDK provides two ways to enable automatic collection

1. Turn on automatic tracking when initializing the SDK

2. Call automatic tracking API

After the automatic tracking function is turned on, it can be turned off at any time. After turning it off, the SDK will no longer generate automatically collected tracking events.

Enable automatic tracking when initializing the SDK, sample code (see the SDK initialization section at the beginning of the document for parameter meanings)

SESDK.init({
  config: {
    autoTrackConfig: {
      autoTrack: true,
      autoTrackPageView: true,
      autoTrackPageClick: true,
    }
  }
})


Automatic buried point acquisition configuration AutoTrackConfig parameter description:

parameter type Is it required? illustrate
autoTrack boolean no Whether to enable automatic point collection for page browsing and clicks. The default is false and is not enabled.
autoTrackPageView boolean no Whether to enable automatic point collection for page browsing. The default is false. If automatic point collection is enabled, manual calls to the page browsing API are prohibited.
autoTrackPageClick boolean no Whether to enable automatic click collection of page element clicks. The default is false. If automatic click collection is enabled, manual calling of the page element click API is prohibited. Only three click event types: tap, longpress, and longtap are supported. Note: If you enable automatic collection of clicks on page elements, then the element needs to be bound to an event to trigger a callback function, and the callback function must be registered in the Page or Component.


Call automatic tracking API, sample code

// 开启自动追踪元素点击 和 页面浏览
// 方式一
SESDK.setAutoTrack({
  autoTrack: true
});
// 方式二
SESDK.setAutoTrack({
  autoTrackPageView: true,
  autoTrackPageClick: true,
});

// 只开启自动追踪元素点击
SESDK.setAutoTrack({
  autoTrackPageClick: true,
});


Turn off automatic tracking, sample code

// 关闭自动追踪
// 方式一
SESDK.setAutoTrack({
  autoTrack: false
});
// 方式二
SESDK.setAutoTrack({
  autoTrackPageView: false,
  autoTrackPageClick: false,
});


4.5 Ignore automatic tracking of a certain page

The SDK provides setTrackPageView to set whether to ignore the automatic collection of the current page; and to add custom attributes to the page. When an automatic tracking event on the page occurs, the custom attributes will be brought along.

After ignoring it, the page will no longer generate the automatic burying event "_mpViewScreen"


After the page ignores automatic click collection, the automatic click collection of all elements in the page will also be ignored.

Note: Ignored pages or elements can support manual call for buried point collection.

Sample code

SESDK.setTrackPageView(Array<{
  path: trackConfig
}>)

path: the path of the current page (the url of the page)

trackConfig parameter description:

parameter name Parameter meaning Parameter Type Is it mandatory?
ignoreTrack Whether to ignore the automatic reporting of browsing behavior corresponding to the path, the default is false. If true, all click behaviors under the corresponding path will also be ignored and automatically reported. boolean no
customProperty Custom attributes when the browsing behavior corresponding to the path is automatically reported object (for specific requirements, see Event Reporting-Custom Attribute Requirements) no

Call example:

SESDK.setTrackPageView([
  {
    'pages/test/test': {
      ignoreTrack: false,
      customProperty: {
        a: 1,
        b: 2
      }
    }
  }
])

4.6 Ignore a certain element and automatically bury point collection

The SDK supports ignoring the automatic tracking collection of a certain element. After ignoring it, the element will no longer generate the automatic tracking collection event "_mpElementClick".

Note: Ignored elements can support manual call for buried point collection.


To ignore an element, bind the attribute data-ignore-track="true" to the element. After being ignored, the element can call the "element click event" method in 6.2

<view data-ignore-track="true" bindtap="clickHandle">我是按钮</view>

注:在页面page或component下需要注册clickHandle回调方法


4.7 Add custom attributes to elements

The SDK supports adding custom attributes to elements. When an automatic collection and buried event of the corresponding element is generated, the custom attributes will be brought along.

The SDK adds element custom properties by binding the attribute data-custom-property on the element. For specific requirements on the custom attribute format, see Event Reporting - Custom Attribute Requirements.

<view data-custom-property="{a: 1, b: 2}" bindtap="clickHandle">我是按钮</view>

注:在页面page或component下需要注册clickHandle回调方法


Previous
Impression level revenue integration
Next
Remote Config & A/B Testing SDK
Last modified: 2026-01-20Powered by