/users/account-created does not include Google Analytics tracking script

AI-generated summary

The discussion addresses the absence of the Google Analytics tracking script on Discourse’s account creation and activation pages. Dreamhearth initiated the thread, noting that these pages lack the script and asking if a pull request was welcome. codinghorror welcomed the contribution, emphasizing the need to ensure new user registration remains functional. scotta expressed strong interest, highlighting the utility for cohort tracking and asking for a timeframe. Dreamhearth responded that a pull request was imminent and outlined future plans for GA Universal configuration in the admin panel. Following this, codinghorror asked techAPJ to implement the change directly. Consequently, techAPJ committed code adding the script to /users/account-created, /users/activate-account, and /users/password-reset pages.

/users/account-created and /users/activate-account currently do not include the Google Analytics tracking script.

I would think the script should be included on these pages so that I can track account creation and account activation events in Google Analytics.

Is there a specific reason GA has been left off of these pages? If not, should I submit a pull request?

1 Like

A pull request would be welcome, thanks! Just make sure new user registration does not get broken as that is a critical path for the app.

(Also, this is not a bug, it does not block normal use of the site.)

1 Like

I’m looking forward to seeing this tracking added to Discourse. I’ve got a user funnel that I use to do my daily cohort tracking. Getting new accounts added to that report will very, very useful.

Any idea on a timeframe before we’ll see this added to the code?

Thanks

Scotta, I’ve done some work on this and I’m hoping to submit the pull request in the next day or two!

One of the things I’d like to work on next is setting up Google Analytics Universal configuration in the admin panel so that you can track users across devices and track custom events such as creating topics, replies, etc. I’m not quite sure what the scope will be yet, but there’s a lot of analytics and tracking functionality we can get out of a little bit of code and that’s what I’ll be shooting for. I haven’t brought this up to the devs yet for their take on it, but I plan to after I submit this pull request.

1 Like

Sounds great Jason. Thanks for your efforts.

Here’s my thoughts from a while back on events to track, Google Analytics Event Tracking.

@Dreamhearth legend! Although it doesnt yet seem to be available yet? I think all your ideas on tracking added to the admin will be awesome.

If Google Analytics is not on these pages (per Site Settings) can you make it so @techapj?

Okay, I just added Google Analytics script on /users/account-created, /users/activate-account and users/password-reset page.

https://github.com/discourse/discourse/commit/05164d4cae5ca6b5bb6a72c5a98ab3471804c021

2 Likes