reportNudgeClicked method
void
reportNudgeClicked(})
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,
);
}