Goals turn raw page views into meaningful conversions. Define a goal once, and HitCounters tracks every visitor who completes it — with the conversion rate and (optional) value attribution.
hcEvent('name') from JavaScript. Best for: button clicks, form submits, video plays, custom interactions.https://example.com/thank-you/thank-youhttps://example.com/orders/signup, purchase, video_play) — case-insensitive.Then add code on your site:
// Anywhere on your site:
hcEvent('signup');
// With a value (e.g. purchase amount):
hcEvent('purchase', 49.99);
Common patterns:
// On a button click
document.querySelector('#signup-btn').addEventListener('click', () => hcEvent('signup'));
// On form submit
document.querySelector('#contact-form').addEventListener('submit', () => hcEvent('contact_form'));
// On a video play
document.querySelector('video').addEventListener('play', () => hcEvent('video_play'));
A given session counts at most once per goal. Refreshing the thank-you page won't inflate your conversion count. For events without a session match (rare; usually means the session is still being processed), we dedupe by visitor + goal + day.
From the Goals page, the play/pause button toggles whether new conversions get recorded for that goal. Deleting removes the goal but keeps past conversions for historical reporting.