# Custom Events
Custom events capture interactions that aren't product-specific—logins, exit intent, newsletter signups, or any behavior relevant to your automations and scoring.
# Prerequisites
Ensure you have:
- Basic tracking script — User.com SDK loaded and ready
- Event triggers identified — Clear user interactions you want to track
- GTM event tracking — Custom events set up for the behaviors you want to capture
# Event naming
All custom events must be prefixed with event.:
// Correct
userengage('event.newsletter_signup', { source: 'footer' });
// Wrong — will not register
userengage('newsletter_signup', { source: 'footer' });
# Login event
Track successful logins to trigger welcome-back automations or update engagement scoring. Create a Custom HTML tag triggered on your login success event:
<script>
if (typeof userengage === 'function') {
userengage('event.login', {
method: {{DLV - login_method}}, // 'email', 'google', 'facebook'
});
}
</script>
# Exit intent event
Capture when Contacts attempt to leave—useful for triggering retention logic or segmenting high-intent abandoners. Create a Custom HTML tag triggered on your exit intent detection:
<script>
if (typeof userengage === 'function') {
userengage('event.exit_intent', {
page_type: {{Page Type}}, // 'product', 'cart', 'checkout', 'category'
cart_value: {{DLV - cart_total}}, // current cart value if available
});
}
</script>
# Additional event examples
# Content engagement
<script>
if (typeof userengage === 'function') {
userengage('event.content_engagement', {
content_type: {{Content Type}}, // 'blog_post', 'video', 'whitepaper'
content_id: {{Content ID}}, // unique identifier
engagement_type: {{Engagement}}, // 'scroll_50', 'time_2min', 'download'
});
}
</script>
# Search interactions
<script>
if (typeof userengage === 'function') {
userengage('event.search_performed', {
search_term: {{Search Term}},
results_count: {{Results Count}},
search_location: {{Page Type}}, // 'header', 'search_page', 'footer'
});
}
</script>
# Event data best practices
Include contextual information for better segmentation:
- Source identification: Where did the interaction occur?
- User context: What page were they on? What's in their cart?
- Business value: Lead scores, engagement levels, conversion potential
- Technical details: Error states, timing information
# Verification
After implementing custom events:
- GTM Preview mode: Verify tags fire on your custom triggers
- Network tab: Filter for requests to
/api/event/— each should return200 OK - Contact timeline: Check Data → Contacts to verify events appear in visitor timelines
- Automation testing: Confirm events trigger expected automations
For complete event tracking documentation, see Tracking Events.
# Next steps
With frontend tracking complete:
- Backend integration — Complete the integration with server-side data
- Marketing consents — Ensure compliance with consent requirements