Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving Referral Rewards #377

Open
ghost opened this issue Aug 3, 2023 · 6 comments
Open

Improving Referral Rewards #377

ghost opened this issue Aug 3, 2023 · 6 comments
Labels
feature new product features that weren't there before needs specification

Comments

@ghost
Copy link

ghost commented Aug 3, 2023

Is your feature request related to a problem? Please describe.
Referrals on Stacker News has seen limited adoption to date, and I believe part of the reason is the barriers to participating in the referral program. Today, stackers must either find the share button on a post or comment or manually add their referral tag to a post prior to sharing it.

In addition, stackers do not receive notifications when a referral earns them sats. The only way to see that information is to open ones referral page in the settings pane. I often open up my referrals page and am surprised when i see how many sats my referrals have earned for me.

Describe the solution you'd like
To improve access to the referral program, Stacker News should append all links with the referral tag of a stacker when they are signed in. This means that moving forward any links shared by a logged in stacker will give them a chance of earning referral rewards.

Furthermore, Stacker News should also create a new notification type that specifically calls out the rewards each stacker earns from their referrals. For example, the copy could read "You stacked X sats today for referring @InsertUsername".

The net effect of these two changes is that referrals are more visible, stackers have a higher chance of earning sats, and they are able to better attribute those sats to the links they shared once they begin earning.

@ghost ghost added the feature new product features that weren't there before label Aug 3, 2023
@byoungdale
Copy link

It looks like the first improvement of adding referral tag on copy already exists here. But, the notifications when earning sats for referrals is not. I will take further a look at that.

@huumn
Copy link
Member

huumn commented Aug 15, 2023

I'd love to see the notifications!

re: referral tags

I think @kerooke means appending the referral fragment to urls in the url bar. If it were to be done, it'd probably require one of two hacks:

  1. middleware to redirect incoming requests from /some/url to /some/url/r/k00b
  2. nextjs router hacking to manipulate the url clientside somehow avoiding navigation

In either case, with our current fragment style /r/usernym, its very nontrivial and will affect (and potentially introduce bugs) on every route across the site given the way nextjs works.

If this is something we want to do, we'll probably want to modify referral codes to use GET params instead, e.g. /some/url?r=k00b.

@byoungdale
Copy link

I think I see how I can get that working without dramatic changes. Having problems with the docker compose setup right now for some unknown reason. Once I sort that out, I'll get moving.

@huumn
Copy link
Member

huumn commented Aug 16, 2023

If it's a problem we can fix or document, please let us know

@byoungdale
Copy link

byoungdale commented Aug 17, 2023

Is this what we are thinking for the automatic referral param for logged in users:

The trouble with the param is the next.js middleware matcher doesn't seem to match on params. So, to get the sn_referrer cookie working on the referral link signups, the middleware has to match on every route request:

export const config = {
  matcher: ['/(.*/|)([?#]?.*)']
}

You can see the changes for the referral param here.

@huumn
Copy link
Member

huumn commented Aug 17, 2023

Yes, that's exactly what he wants!

So, to get the sn_referrer cookie working on the referral link signups, the middleware has to match on every route request

I think that should be okay so long as the logic is lightweight.

You can see the changes for the referral param here.

I recommend mutating the route in pages/_app.js ... we already mutate the route there for other reasons in a way that doesn't cause excess navigation.

When you're ready, let's make this a PR so I can provide you with line by line context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new product features that weren't there before needs specification
Projects
None yet
Development

No branches or pull requests

2 participants