email.onClicked
A tracked link was followed — with the URL, client details, and a bot verdict.
Fires when a tracked link in a message is followed. url says which link; client, device, and location details come along when available, plus emailkit’s botDetection verdict so link scanners don’t count as engagement.
hooks: {
email: {
onClicked: async (event) => {
if (event.botDetection?.isBot) return;
await recordClick(event.messageId, event.url);
},
},
},
How the classifier decides — and the exported checkClickBot helper — is covered in Bots don’t count.
Payload
emailDriver?string
EmailKit driver id that produced this event, attached by the EmailKit client.
stringschemaVersion?"1"
Schema version for forward-compat
"1"eventId?string
Unique event identifier for dedupe
stringmessageIdstring
Unique message identifier from the email provider
stringproviderId?string
Provider-specific message identifier (in addition to messageId). This is the provider's internal ID for this message, separate from the RFC Message-ID. Useful for provider-specific operations or tracking.
stringrecipientstring
Email address of the recipient (always available)
stringstatus| "sent"
| "delivered"
| "opened"
| "clicked"
| "bounced"
| "complained"
| "rejected"
Event status/type
| "sent"
| "delivered"
| "opened"
| "clicked"
| "bounced"
| "complained"
| "rejected"timestampDate
Timestamp when the event occurred
Datefrom?EmailAddress
Sender email address (available in sent/accepted events)
EmailAddressto?EmailAddress[]
Recipient email addresses (available in sent/accepted events)
EmailAddress[]subject?string
Email subject (available in sent/accepted events)
stringtags?EmailTag[]
Custom metadata/tags associated with the email
EmailTag[]metadata?Record<string, string>
Custom metadata key-value pairs
Record<string, string>campaignId?string
Campaign or tracking identifier
stringrecipientDomain?string
Domain of the recipient (e.g., "gmail.com")
stringserver?string
Receiving server information
stringraw?unknown
Provider-specific raw data (for debugging or advanced use cases)
unknownip?string
IP address of the user who opened/clicked
stringuserAgent?string
User agent string of the browser/client
stringlocation?{
/** City name */
city?: string;
/** Country code or name */
country?: string;
/** Region/state */
region?: string;
/** Timezone */
timezone?: string;
}
Geolocation information
{
/** City name */
city?: string;
/** Country code or name */
country?: string;
/** Region/state */
region?: string;
/** Timezone */
timezone?: string;
}deviceType?string
Device type (mobile, desktop, tablet, etc.)
stringclientType?string
Email client name (Gmail, Outlook, etc.)
stringos?string
Operating system
stringbotDetection?{
/** Whether this is detected as a bot */
isBot: boolean;
/** Reason for the bot detection decision */
reason: string;
}
Bot detection result
{
/** Whether this is detected as a bot */
isBot: boolean;
/** Reason for the bot detection decision */
reason: string;
}url?string
URL that was clicked
string