Hi team, After restart the growthbook docker servi...
# ask-questions
h
Hi team, After restart the growthbook docker service, I can no longer track the experiment. I expect to reach
on_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:
Copy 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
f
you should check to see what the feature payload is
🙏 1
h
Thanks Graham! Could you please be more specify? I donot see "feature payload" tab.
Plus, I just tried javascipt sdk and it can activate on_experiment. Python sdk still cannot.
f
if you go to the SDK page
and on each one, there should be a 'full sdk' url
make sure that the SDK you're using in Python is returning a payload
(by opening that URL in a browser)
h
the full API endpoint url do return a payload
@fresh-football-47124 Is there any other possible cause. Or should I provide more info?
@fresh-football-47124 hi Graham, still looking forward to your reply Huge thanks!