Custom event goals
Count button clicks and other actions as custom events with the puremetrix() function, then turn them into goals.
Send an event
puremetrix('signup');
puremetrix('purchase', { props: { amount: 49 } }); If your code can run before the tracker has loaded, add this line once before it. Early calls are queued and sent as soon as the tracker is ready (the WordPress plugin adds it for you):
<script>window.puremetrix=window.puremetrix||function(){(window.puremetrix.q=window.puremetrix.q||[]).push(arguments)};</script> Create a goal
- Site settings → Goals → add a custom event.
- Use exactly the event name your code sends (e.g. signup).
- Click once as a test, then check Realtime or Goals.
Verify
- Open https://app.puremetrix.org and check that the menus and buttons match this guide.
- After changing the tracking code, open your site in a private browser window and check that the visit shows up in Realtime.
- If numbers look wrong, check the domain and public key, your pageview limit (or whether the trial has ended), and your bot and user-role exclusions.