Hello all, I recently turned on an experiment with...
# ask-questions
l
Hello all, I recently turned on an experiment with a forced rule. Is it possible to see data of the exposed users? Do forced rules support tracking and viewing the tracked exposures?
w
Growthbook doesn't store any of your data on its servers. You need to send to your data warehouse the information that you want. All SDKs should have a function similar to
onFeatureUsage
. For example in React: https://docs.growthbook.io/lib/react#feature-usage-callback. You can you then send a tracking event to your data warehouse to analyze it.
l
Maybe let me rephrase. All other experiments have data showing up in them, but the experiment with the forced rule doesn't have any data showing up even though it is enabled and the tracking is on. Normally if there is no data I see the text
no data yet
but I don't see that in this case. Is it designed not to load any data at all?
w
Sorry to have misread your question. Do you have a forced rule above the experiment? GB evaluates the first matching rule.
If all of the users are getting a forced value and none of them are getting to your experiment rule then none of them would be tracked in the experiment.
l
The forced rule is only a fraction of all existing users. Let me add this screenshot. You could advise accordingly.
w
And you have a 2nd experiment rule below that?
l
No.
w
Do you have any other rules below that?
l
No, there is only one forced rule
w
Ok then it is not an experiment .. its just a feature flag.
You can track feature flag usage if you like with the link in my first comment:
onFeatureUsage
. But
trackingCallback
will not be called because it is not assigning an experiment. Does that answer your question?
l
That's very helfpul. Thank you. One more question, since this was already rolled out, featureusage will apply on the future calls only but the already exposed ones will be lost data, right?
w
right
👍 1
l
Thank you!
w
your welcome. Sorry to hear that you might have lost business data that you need. If you have any ideas on what we could have changed in the UI or in the docs to make it clearer what the expected behavior is let us know.
l
I am not sure if it was already in the docs, but I am thinking it is helpful to know which functions are called under what circumstances. In the python section, I don't see onFeatureUsage, but I see these in the package decalrations and I am not sure how to go about it.
Copy code
def __init__(
        self,
        enabled: bool = True,
        attributes: dict = {},
        url: str = "",
        features: dict = {},
        qa_mode: bool = False,
        on_experiment_viewed=None,
        api_host: str = "",
        client_key: str = "",
        decryption_key: str = "",
        cache_ttl: int = 60,
        forced_variations: dict = {},
        # Deprecated args
        trackingCallback=None,
        qaMode: bool = False,
        user: dict = {},
        groups: dict = {},
        overrides: dict = {},
        forcedVariations: dict = {},
    )
This is how i was setting up my tracking
Copy code
self.gb = GrowthBook(
            attributes=self.attributes,
            features=features,
            trackingCallback=self.on_experiment_viewed if not do_not_track else None,
        )
w
Sadly it doesn't seem to be implemented yet.
You could implement a wrapper function on your side for all gb.is_on, is_off, _get__feature_value or evalFeature call in your code that it calls your tracking code before doing the growthbook function.