Skip to main content

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:

  1. Basic tracking script — User.com SDK loaded and ready
  2. Event triggers identified — Clear contact interactions you want to track
  3. 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?
  • Contact 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:

  1. GTM Preview mode: Verify tags fire on your custom triggers
  2. Network tab: Filter for requests to /api/event/ — each should return 200 OK
  3. Contact timeline: Check Data → Contacts to verify events appear in visitor timelines
  4. Automation testing: Confirm events trigger expected automations

For complete event tracking documentation, see Custom events.

Next steps​

With frontend tracking complete: