https://www.growthbook.io/ logo
#give-feedback
Title
# give-feedback
m

mysterious-nail-58688

09/14/2023, 6:00 PM
I tried passing some cookie values to the growthbook attributes so that I can exclude users with those cookies. I was very surprised that attributes with a value of undefined passed the override rule test “if cookie1 exists”. Is this the intended behavior?
Copy code
// js-cookie returns a string value of the cookie or undefined if it doesn't exist
const thirdPartyCookies = {
  cookie1: Cookies.get("cookie1"),
  cookie2: Cookies.get("cookie2"),
  cookie3: Cookies.get("cookie3"),
};

gbInit.setAttributes({
  ...gbInit.getAttributes(),
  ...thirdPartyCookies,
  id: svc.userId,
});
b

brief-honey-45610

09/14/2023, 6:16 PM
Hi Jesse, thanks for reaching out! I’ll double check with Engineering and reply here with an update as soon as I can
m

mysterious-nail-58688

09/14/2023, 6:16 PM
Thanks!
b

brief-honey-45610

09/14/2023, 6:58 PM
Hi again, Jesse, would you be able to send me a screenshot of where you have this configured?
m

mysterious-nail-58688

09/14/2023, 6:59 PM
Yes. This was on a feature rule. Cookie name is auid
b

brief-honey-45610

09/15/2023, 3:48 AM
Hi Jesse, my apologies for the delay here. We actually had to do quite a bit of digging to try to sort out why this might be happening.
Where we've gotten to is that we might be missing a test case in our Javascript SDK for this. The
undefined
is javascript-specific. Most languages don't have an equivalent to that, so I don't think it's part of our shared test suite between all of the SDKs. We would have to write a custom test case just for the javascript SDK. I'm going to create a GitHub issue for this and let our engineering team know about it. I'll share the link to the GH issue so you can follow it
m

mysterious-nail-58688

09/15/2023, 3:50 AM
Okay! Thanks for getting back. I was able to work around by simply iterating over the object keys and deleting any with undefined values.
b

brief-honey-45610

09/15/2023, 3:52 AM
You're welcome! That sounds like a good approach for the time being. I will create the issue tomorrow and share the link here. Have a good evening!
m

mysterious-nail-58688

09/15/2023, 3:54 AM
Thanks. You too
😊 1
16 Views