'signup_source' parameter in URL

AI-generated summary

The discussion revolves around adding a custom ‘signup_source’ parameter in the URL to identify users signing up from a Discourse forum versus a website. Suhotra_Roychoudhury wants to segregate users coming from the forum and those signing up directly on the website for different email flows.

Merefield suggested using the external_id, but Suhotra_Roychoudhury clarified that this is pushed from the app end to Discourse, whereas they need a parameter in the URL that Discourse sends when users click on login.

Simon suggested adding a query parameter to the discourse_connect_url site setting on Discourse, which will be preserved when Discourse redirects users to the SSO auth provider site.

Suhotra_Roychoudhury further explained the problem, wanting to record users signing in from the Discourse forum using something equivalent to a UTM parameter, to understand which visitors are signing up via the forum.

Simon proposed updating the code on the website to check for sso and sig query parameters and add metadata to the user record, indicating that the signup was initiated from Discourse.

I’ve applied Discourse Connect for single sign-on. Now, I want to segregate users coming from the forum from those who have signed up directly on the original website. How can I add a custom parameter to identify users coming from the forum? Does Discourse offer any ‘signup_source’ parameter in the URL?

Use external_id?

external_id is something that is pushed from the app end to discourse while creating the user (the app is the identity provider in this case)
What we need is a parameter in the url that discourse sends us to when we click on login. Does Discourse offer this?

I’m not quite following the problem you are trying to solve, but you can add a query parameter to the discourse_connect_url site setting on Discourse. For example: http://localhost:1234/sso?site=foo

That query param will be preserved when Discourse redirects users to the SSO auth provider site when users login to Discourse.

For context, I think this is one possible approach for allowing a single DiscourseConnect provider site to authenticate users on multiple Discourse sites. There are more details than that required for the implementation though.

If this doesn’t solve the problem for you, maybe try explaining to us again what you are wanting to accomplish.

Hi @simon Thanks for your input.

The short version: Get something equivalent to a UTM parameter to record users signing in from Discourse forum. We have enabled SSO for unifying our product and forum signups. The idea is to understand which visitors are signing up via the forum and segregate them from the ones signing up via our website.

The long version: Visitors signing up from our website receive an email flow. We want to create a separate email flow for our users coming from the forum since the intent is different. For this, we need a tag to identify users coming from the forum in our data management tool.

Wondering if Discourse provides any identification for this?

Hope the problem statement is clear now?

Yes, that makes sense.

When a user clicks the “login” button on Discourse, they will be redirected to the URL on your website that you have added to the discourse connect url setting on Discourse. That URL will have sso and sig query parameters.

If the user doesn’t yet have an account on your website, I’m assuming you are taking them through the website’s registration process. It might be possible to update the code on your website to check for those query params and add some metadata to the user record to indicate that the signup was initiated from Discourse if the params are present.