How to track custom events without cookies
Set up custom event tracking for button clicks, form submissions, and signups. A practical guide to measuring what matters on your site.
Pageviews tell you where people go. Custom events tell you what they do. Tracking clicks, form submissions, and signups gives you a complete picture of how visitors interact with your site.
What are custom events?
Custom events are actions you define and track beyond standard pageviews. They capture specific interactions that matter to your business:
- Button clicks (signup, download, add to cart)
- Form submissions (contact forms, newsletter signups)
- Video plays
- File downloads
- Scroll milestones
- Feature usage in web apps
Glyphex tracks these without cookies. The event data is aggregated and anonymous, just like pageview data.
Adding events to your site
Basic syntax
After installing the Glyphex tracking script, you can fire custom events from anywhere in your JavaScript:
// Track a simple event
glyphex.track('signup');
// Track an event with properties
glyphex.track('download', { file: 'pricing.pdf' });That's it. No extra scripts to load, no configuration files to edit.
Button click tracking
The most common use case. Add an event to any button:
<button onclick="glyphex.track('cta-click')">
Get started
</button>Or in a framework like React:
<button onClick={() => glyphex.track('cta-click')}>
Get started
</button>Form submission tracking
Track when users complete a form:
document.querySelector('#signup-form').addEventListener('submit', () => {
glyphex.track('form-submit', { form: 'signup' });
});Outbound link tracking
Know when visitors click links to external sites:
document.querySelectorAll('a[href^="http"]').forEach(link => {
link.addEventListener('click', () => {
glyphex.track('outbound-click', { url: link.href });
});
});Naming conventions
Good event names make your data readable months later. Bad names create confusion.
Keep names consistent
Pick a format and stick with it:
- Use lowercase with hyphens:
form-submit, notFormSubmitorform_submit - Be specific:
pricing-cta-clicknot justclick - Use verb-noun format:
download-pdf,play-video,submit-form
Group related events
Use prefixes to organize events by area:
signup-start
signup-complete
signup-error
checkout-begin
checkout-payment
checkout-completeThis makes filtering and analysis much easier.
Viewing event data
In Glyphex, navigate to the Events section of your dashboard. You'll see:
- Event counts: How many times each event fired
- Unique triggers: How many distinct visitors triggered each event
- Trends: How event volume changes over time
Filter by date range, event name, or properties to drill into the data.
Practical examples
Measuring signup funnel
Track each step of your signup process:
// User lands on pricing page (automatic pageview)
// User clicks "Start free trial"
glyphex.track('trial-start-click');
// User completes signup form
glyphex.track('trial-signup-complete');
// User activates account
glyphex.track('trial-activated');Now you can see exactly where people drop off.
Tracking content engagement
Understand how people consume your content:
// Track scroll depth
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
glyphex.track('scroll-milestone', { depth: '50%' });
observer.disconnect();
}
});
});
observer.observe(document.querySelector('#halfway-marker'));
// Track time on page
setTimeout(() => {
glyphex.track('engaged-reader');
}, 30000); // 30 secondsMeasuring feature adoption
For web apps, track which features people actually use:
// User creates a project
glyphex.track('feature-use', { feature: 'create-project' });
// User invites a team member
glyphex.track('feature-use', { feature: 'invite-member' });
// User exports data
glyphex.track('feature-use', { feature: 'export-csv' });Common mistakes
Tracking too much
Not every interaction needs an event. Focus on actions that tie to business outcomes. Tracking every hover and scroll creates noise without insight.
Tracking too little
At minimum, track your key conversion points. If you sell something, track the purchase. If you collect leads, track the form submission. Start with what matters most and expand later.
Inconsistent naming
signup, sign-up, user_signup, and SignUp will show as four separate events. Document your naming convention and follow it.
Forgetting to test
Always verify events fire correctly before relying on the data. Open your Glyphex dashboard, trigger the event, and confirm it appears.
Privacy considerations
Custom events in Glyphex follow the same privacy principles as pageview tracking:
- No cookies are set
- No personal data is collected
- Event data is aggregated, not tied to individuals
- No consent banner needed
You can track user behavior without tracking users.
Start with your most important conversion action. Add one event, verify it works, and build from there. Within a week you'll have a clear picture of how visitors interact with your site.