On earlier versions Create New Account button was passive until all sign up fields (required fields) filled and I was tracking new sign ups by track Create New Account button clicks with tag manager.
But now this button is active and clickable without filled all sign up fields.
If a visitor click this button without filled all fields click is counted.
I’m not seeing anyway to only track successful clicks on the signup button. You could try tracking clicks of the “Click here to activate your account” button:
It is also possible to track signups with a User Event webhook. That is a very different approach than what you are currently using though. You’d need to configure an external service to listen for the webhook and then filter the user webhooks to only collect data when the X-Discourse-Event: user_created header is set in the request.
It might be possible to hook into the user_created event and use that to send data to an analytics platform. If that was the case, it would be possible to do something like this. Note that this code doesn’t work:
<script type="text/discourse-plugin" version="0.11.0">
api.onAppEvent("user:created", user => {
if (user) {
window.dataLayer.push({
'event': 'userCreated'
});
}
});
</script>
As far as I can tell, the user_created event is not available on the client, so the above code will not work. If anyone knows if it’s possible to catch the user_created event on the client, please let me know.