Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

曝光采集是否不准确 #139

Open
mfnmeifannao opened this issue Sep 9, 2024 · 0 comments
Open

曝光采集是否不准确 #139

mfnmeifannao opened this issue Sep 9, 2024 · 0 comments

Comments

@mfnmeifannao
Copy link

2.3.3.2. 标记所有行
tableView一页只有15条数据
滚动后查看曝光上报的View是有重复的 且不是全部数据数量不够
以下是代码

/**
页面曝光
view: 需要曝光的View
eventName: 事件名
exposureIdentifier: 唯一标识
properties: 自定义属性
*/

  • (void)addExposureView:(UIView *)view eventName:(NSString *)eventName exposureIdentifier:(NSString *)exposureIdentifier dict:(NSDictionary *)properties {

    if (view == nil) { return; }
    /**
    曝光的可见比例,有效值范围 0~1,
    默认值为 0,代表元素只要露出就满足可见比例条件
    最大值为 1,代表元素需要完全露出才可满足可见比例条件

    有效停留时长,单位为秒
    默认值为 0,代表元素只要满足了可见比例,有效停留时长就可满足

    是否允许采集重复曝光
    默认值为 YES,及允许采集重复曝光
    */
    SAExposureConfig *exposureConfig = [[SAExposureConfig alloc] initWithAreaRate:0 stayDuration:0 repeated:NO];
    SAExposureData *exposureData = [[SAExposureData alloc] initWithEvent:eventName properties:properties exposureIdentifier:exposureIdentifier config:exposureConfig]; // 此处的曝光标识,需要传入需要标记的列表元素的唯一标识
    [[SensorsAnalyticsSDK sharedInstance] addExposureView:view withData:exposureData];

}

  • (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    JobModel *model = [self.dataArray objectAtIndexCheck:indexPath.row];
    XxCell *cell = [tableView dequeueReusableCellWithIdentifier:@"XxCell" forIndexPath:indexPath];
    cell.model = model;

      // 曝光标识
      cell.exposureIdentifier = @(model.cid).stringValue;
      NSDictionary *saDict = @{
          @"xxx" : @"xxx"
      };
      [BJXSensorsAnalyticsTool addExposureView:cell eventName:@"app_show" exposureIdentifier:@(model.cid).stringValue dict:saDict];
      
      return cell;
    

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant