reportNudgeClicked method

void reportNudgeClicked(
  1. CEPTriggerPayload payload, {
  2. String? elementId,
  3. String? ctaLabel,
  4. String? actionType,
  5. String? actionUrl,
  6. String? ctaRole,
})

Fired when the user taps a nudge CTA. A primary CTA tap is the nudge's CEP engagement signal and emits ExperienceClicked on the coarse channel; secondary taps stay Digia-only. time_to_action_ms is the dwell so far (nudge still open).

Implementation

void reportNudgeClicked(
  CEPTriggerPayload payload, {
  String? elementId,
  String? ctaLabel,
  String? actionType,
  String? actionUrl,
  String? ctaRole,
}) {
  if (ctaRole == 'primary') {
    _events.toCep(ExperienceClicked(elementId: elementId), payload);
  }
  _events.toDigia(
    NudgeClicked(
      elementId: elementId,
      ctaLabel: ctaLabel,
      actionType: actionType,
      actionUrl: actionUrl,
      ctaRole: ctaRole,
      timeToActionMs: _dwellTracker.elapsedMs(payload.cepCampaignId),
    ),
    payload,
  );
}