https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
b

busy-horse-73824

05/19/2022, 5:02 PM
👋 We currently use Google Optimize, but keen to move to Growthbook Using something like the visual editor, we'd like to be able to set up redirect tests - so when a user arrives on a page, if they're in the test group, they'd be redirected to the alternative page How can that be achieved?
For context, this is because we're wanting to use GB from more of a low-level in our engineering team Our growth team run a site on Webflow (mojo.so) and regularly run redirect based tests with Optimize. They're keen to try out GB, but don't have much direct engineering ability
f

fresh-football-47124

05/19/2022, 5:29 PM
hi James
👋 1
f

future-teacher-7046

05/19/2022, 5:34 PM
We don't support redirect tests with the visual editor. Our visual editor is still in beta and has limited functionality compared to something like Optimize. Our primary use case is engineers implementing tests with code.
b

busy-horse-73824

05/19/2022, 6:13 PM
Yep totally appreciate that the visual editor doesn't do that The key question remains though - how could we achieve something like that? Eg might we create features in a certain way and write some generic JS, how have you seen other customers do that kind of thing?
f

future-teacher-7046

05/19/2022, 6:25 PM
You could in theory make a feature with a
string
datatype that you evaluate on every page load:
Copy code
const value = growthbook.getFeatureValue("url-redirect", "")
if (value) {
  window.location = value
}
Then you could set up a feature like this:
b

busy-horse-73824

05/19/2022, 6:25 PM
Ah that's cool, maybe we can automatically detect the right features with some tagging or conventions too. Will have a look when I get a chance 👌
f

future-teacher-7046

05/19/2022, 6:26 PM
It's pretty dangerous to have redirect urls come directly from a feature. I would definitely add some sanity checks and protections around which URLs are allowed to be redirected to (e.g. must start with a slash)
b

busy-horse-73824

05/19/2022, 6:27 PM
Hmm we wouldn't give random people access to change things in our Growthbook account - are you suggesting we shouldn't trust the feature data for some reason?
Struggling to understand what would make it different from eg Google Optimize
f

future-teacher-7046

05/19/2022, 6:28 PM
I guess it's not that different from Optimize. It's more typos that you would have to watch out for
b

busy-horse-73824

05/19/2022, 6:28 PM
Yeah fair enough, it would probably make sense to have a list of trusted origins
f

future-teacher-7046

05/19/2022, 6:28 PM
Or forgetting to add a targeting condition properly so it redirects every page of your site instead of just the intended page
👍 1
b

busy-horse-73824

05/19/2022, 6:29 PM
Haha we have had that before 😂
14 Views