https://www.growthbook.io/ logo
h

helpful-hydrogen-62495

10/01/2022, 5:51 PM
@future-teacher-7046 How feasible would it be to develop “OR” operators for adding metrics (with Mixpanel data source)?
f

fresh-football-47124

10/01/2022, 5:52 PM
Probably not too hard
f

future-teacher-7046

10/01/2022, 5:52 PM
It's really easy to just give you a javascript input where you can write whatever conditions you want.
h

helpful-hydrogen-62495

10/01/2022, 5:54 PM
i mean sure I can javascript
just for some context, my use case right now is I have two different IDs that I need to track as part of an event, so ideally I can just so “Event Name” where property = a or property = b
If that’s something you guys can jazz up, would be great. In the meantime, I have to make one metric per unique ID and that makes it difficult to fully understand the results
f

future-teacher-7046

10/01/2022, 6:01 PM
Raw javascript input is the fastest to implement. I can see us adding more operators in the future too, like
is in the list
. Also, last week we just launched support for "OR" in the event name. So you can now do something like
Viewed Cart OR Purchased
to match multiple events.
h

helpful-hydrogen-62495

10/01/2022, 6:02 PM
Happy to get a raw JS input 🙂
Not sure I’m seeing the OR in the event name… maybe not for Mixpanel data source?
f

future-teacher-7046

10/01/2022, 6:03 PM
It's still just a single text input, but you can now type "OR" to separate multiple event names
It copies the syntax Mixpanel uses for their custom events
Actually, I just realized we already have regular expression support. You can use that match against multiple values.
The
~
operator is a regular expression match.
h

helpful-hydrogen-62495

10/01/2022, 6:11 PM
ah cool
cool lets see if this works
got an error
do I need to wrap it in parenthesis myself?
nope that didnt do it either
f

future-teacher-7046

10/01/2022, 6:15 PM
Looks like that event property doesn't exist for every event
We should fix that on our end. For now, for the property name can you try this?
Copy code
(event.properties.videoId||"")
h

helpful-hydrogen-62495

10/01/2022, 6:19 PM
how do I input that into the UI?
f

future-teacher-7046

10/01/2022, 6:19 PM
Instead of
videoId
in the condition
h

helpful-hydrogen-62495

10/01/2022, 6:20 PM
great that seems to have successfully queried, let me check now that its actualy the right data
4 Views