:wave: We currently use Google Optimize, but keen...
# ask-questions
b
👋 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
hi James
👋 1
f
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
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
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
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
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
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
I guess it's not that different from Optimize. It's more typos that you would have to watch out for
b
Yeah fair enough, it would probably make sense to have a list of trusted origins
f
Or forgetting to add a targeting condition properly so it redirects every page of your site instead of just the intended page
👍 1
b
Haha we have had that before 😂