bodyTrack property

  1. @override
Map<String, Object> get bodyTrack
override

Implementation

@override
Map<String, Object> get bodyTrack {
  var customBody = new Map<String, Object>();
  customBody.addAll({
    "t": typeOfEvent,
    "ea": this.action,
    "ec": (this.category == EventCategory.Action_Tracking)
        ? ActionTracking
        : UserEngagement
  });
  // Add label if not null
  if (label != null) {
    customBody['el'] = label ?? "";
  }
  // Add value if not null
  if (value != null) {
    customBody['ev'] = value ?? 0;
  }
  // Add commun body
  customBody.addAll(super.communBodyTrack);

  return customBody;
}