The discussion revolves around tracking sign-ups on Discourse, specifically focusing on the “Create New Account” button. ufukayyildiz notes that the button is now active even when required fields are incomplete, leading to inaccurate tracking of sign-ups via Google Tag Manager. simon suggests tracking the “Click here to activate your account” button instead, but ufukayyildiz points out this isn’t viable for social sign-ups. simon proposes using a user_created event via a webhook or client-side JavaScript, but acknowledges the event isn’t currently available on the client. The thread ends with both users expressing interest in finding a solution for reliable sign-up tracking.
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.