hundreds-airline-63866
03/24/2025, 2:42 AMon_experiment_viewed
with printed lines when I run gb.get_feature_value.
However the only result is True/False.
Here is the dummy python code:
from growthbook import GrowthBook
# User attributes for targeting and experimentation
attributes = {'user_id': 'xxxx'}
def on_experiment_viewed(experiment, result):
# TODO: Use your real analytics tracking system
print("Viewed Experiment")
print("Experiment Id: " + experiment.key)
print("Variation Id: " + result.key)
# Create a GrowthBook instance
gb = GrowthBook(
on_experiment_viewed = on_experiment_viewed,
api_host = "<http://xxxxxxxxx>",
client_key = "sdk-xxxxxxx"
)
>>> gb.set_attributes(attributes)
# Load features from the GrowthBook API with caching
>>> gb.load_features()
# Simple on/off feature gating
>>> gb.is_on("exp_id")
True
# Get the value of a feature with a fallback
>>> gb.get_feature_value("exp_id", "fallback")
True
fresh-football-47124
hundreds-airline-63866
03/24/2025, 6:29 AMhundreds-airline-63866
03/24/2025, 6:30 AMfresh-football-47124
fresh-football-47124
fresh-football-47124
fresh-football-47124
hundreds-airline-63866
03/24/2025, 9:45 AMhundreds-airline-63866
03/24/2025, 9:48 AMhundreds-airline-63866
03/25/2025, 11:17 AM