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

late-spring-83291

09/25/2023, 8:23 AM
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

white-fireman-22476

09/25/2023, 8:38 AM
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

late-spring-83291

09/25/2023, 8:59 AM
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

white-fireman-22476

09/25/2023, 9:45 AM
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

late-spring-83291

09/25/2023, 9:48 AM
The forced rule is only a fraction of all existing users. Let me add this screenshot. You could advise accordingly.
w

white-fireman-22476

09/25/2023, 9:49 AM
And you have a 2nd experiment rule below that?
l

late-spring-83291

09/25/2023, 9:49 AM
No.
w

white-fireman-22476

09/25/2023, 9:49 AM
Do you have any other rules below that?
l

late-spring-83291

09/25/2023, 9:50 AM
No, there is only one forced rule
w

white-fireman-22476

09/25/2023, 9:51 AM
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

late-spring-83291

09/25/2023, 9:53 AM
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

white-fireman-22476

09/25/2023, 9:54 AM
right
👍 1
l

late-spring-83291

09/25/2023, 9:54 AM
Thank you!
w

white-fireman-22476

09/25/2023, 9:56 AM
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

late-spring-83291

09/25/2023, 10:21 AM
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

white-fireman-22476

09/25/2023, 10:33 AM
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.
16 Views