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

bulky-monkey-20562

10/05/2023, 1:24 PM
Hi team! I am trying to run A/B test on targeted url.
Copy code
growthbook.setAttributes({
      id: '12345',
      url: window.location.pathname,
 });
But always getting `false`from the feature.
Is there anything else which I am missing. It is working when I am not setting url targeting
c

cuddly-finland-73937

10/05/2023, 1:27 PM
if you print
window.location.pathname
to console does it return what you are expecting it to be?
I expect it does but that is the equivalent of "is it plugged in" check
b

bulky-monkey-20562

10/05/2023, 1:28 PM
Copy code
useEffect(() => {
    // Load features asynchronously when the app renders
    growthbook.loadFeatures();
    growthbook.setAttributes({
      id: getGAClientID(),
      url: window?.location?.pathname || "",
    });
  });
how should I run A/B test only on specific urls
any idea?
3 Views