Add label from button click?

Here’s an odd one for ya:

I want to do some beta testing of features/posts. I’d like to offer members the chance to opt into being a beta tester. So I’d like to send them an email with an opt in button and if they click it, ghost adds a label to their member record called beta tester or something.

Is this possible?

It’s possible, but it’d require a custom implementation using the Admin API or Zapier.

Another simpler solution might be to just send out a Google Form that pumps the results to Sheets (or any form + CSV flow). Then, you can just export a CSV and upload it in Ghost to apply the labels.

1 Like

I know a user can get a label added when they sign up. Is there no way to add one from the member side later?

1 Like

Seems rather complicated for such a simple task. Allow people to opt into beta (or whatever, doesn’t have to be beta) - should that require four steps plus 3rd party apps?

Don’t get me wrong, I am really liking ghost, but it feels like there are some very simple implementations that don’t end up being very simple to execute.

1 Like

In theory, can the API be trigger from a page? Imagine this workflow if you would:

Email only post. “Would you like to join the beta? Follow this link to sign up!”

The link brings them to a Beta Test Landing Page, the act of landing on that page triggers the API to add a label ‘BETATESTER’ or whatever. B/c they are on a page on the site, we have their member info - right?

So the loading of the page would somehow have to trigger the API which would be able to get their username/email from the session (I think, right, maybe, I dunno?). And then the API uses that info to add the label.

I have no idea how to implement this but the logic feels sound. I think?

1 Like

Yeah I think that it is possible, because of using Admin API we should bring that final Admin API request to some more secure environment, like Cloudflare Workers where we can make final Admin API call with admin key to update member label.

So it can look somehow like this:
Email → Page → Cloudflare request from page with user info → cloudflare worker update member label via admin API.

So yeah, I can’t figure out how to get a label added to a member without using admin permissions /except/ in the initial magic link sign-up. I did some tire kicking to see if I could send a label on a sign-in request, but Ghost ignored it.

I think @Ravn is right - you’d need to stand up a cloud function somewhere that knows your Admin API key and can make the call. (I’d vote Netlify over Cloudflare, having used both.)

Another option would be to use a newsletter toggle to track who had opted in, but it might be confusing if you’re using portal for your membership pages, since your beta testers setting would appear like a newsletter… still, it does avoid needing a cloud function to call the Admin API, since members can change their own newsletter settings.

1 Like

Thanks for this! I have a VPS at Oracle that runs a cronjob with a script to check for expired subscriptions and then add a label to them based on how long they’ve been expired. Could I use that same VPS for this? What we’re talking about is pretty far out of my knowledge base.

Thank you Cathy, yes Netlify or Vercel might be easier to setup talking with Ghost Admin API.

It could be possible, but you would need to spin-up simple web-server (express, flask or similar one) on different port, waiting to catch request from page then update label from that simple server. I think it is easier to spin it up on cloud. We don’t have to worry if server is live, it is live all the time on “server-less” environment.

1 Like