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

cool-apple-97384

10/13/2022, 4:16 AM
Hi there, may I know when this code will be called?
Copy code
growthBookTrackingCallBack: (gbExperiment, gbExperimentResult) {}
Because I was tried to assigned user to specific value, that method never called. Thanks.
f

fresh-football-47124

10/13/2022, 4:17 AM
Which SDK is that? It should be called when a user is assigned to a variation within an experiment
happy to help you debug if you share more of the code
c

cool-apple-97384

10/13/2022, 4:18 AM
I use Flutter SDK @fresh-football-47124
I was intance an Growthbook SDK via wrapper using this code
Copy code
GrowthBook(
        apiHost: F.growthBookApiHost,
        apiKey: growthBookApiKey,
        isQAMode: (F.appFlavor == Flavor.staging),
        trackingCallback: (experiment, result) {
          // any tracker method
        },
      ),
Then in specific page, I was get assigned value using this code
Copy code
const id = 'pdp-palingmurah';
    final feature = _growthBook.instance.feature(id);

    if (feature.value == 'PDP-Title') {
      _cheapestBadge.value = CheapestType.title;
    } else if (feature.value == 'PDP-Price') {
      _cheapestBadge.value = CheapestType.price;
    }
f

fresh-football-47124

10/13/2022, 4:20 AM
and how were you testing it?
c

cool-apple-97384

10/13/2022, 4:20 AM
When I access that page, the callback above never called. I was added breakpoint
f

fresh-football-47124

10/13/2022, 4:20 AM
are you setting the user attributes?
c

cool-apple-97384

10/13/2022, 4:21 AM
Yes I setting the user attributes after login
The instance called before login method executed
f

fresh-football-47124

10/13/2022, 4:22 AM
Can you debug what the feature(id) is returning?
c

cool-apple-97384

10/13/2022, 4:23 AM
Yes @fresh-football-47124 I receive assigned value. In several account I use forced value. When I debug and trial the app. The value assigned based on forced value assigned.
f

fresh-football-47124

10/13/2022, 4:24 AM
okay, for forced values, that tracking callback wont be called
c

cool-apple-97384

10/13/2022, 4:24 AM
I see. So, if I want to check the callback, I need to use an user that not registered in forced value?
f

fresh-football-47124

10/13/2022, 4:25 AM
yes, you need to have a user that will be included in an experiment
c

cool-apple-97384

10/13/2022, 4:31 AM
Ok @fresh-football-47124 thanks for the information I will try with another user.
👍 1
f

fresh-football-47124

10/13/2022, 4:31 AM
you could also remove the force rule
c

cool-apple-97384

10/13/2022, 4:44 AM
Hi @fresh-football-47124 I was test using another account but the value always assigned using default value. I try set default value with variation 1, user will received variation 1. Then, I change default value with variation 2, user will recieved variation 2. What should I do?
f

fresh-football-47124

10/13/2022, 4:45 AM
can you share the rules?
c

cool-apple-97384

10/13/2022, 4:46 AM
This is the rule @fresh-football-47124
f

fresh-football-47124

10/13/2022, 4:47 AM
is the ID being set before the feature is evaluated?
c

cool-apple-97384

10/13/2022, 4:48 AM
Yes I was instance the GrowthBook first after main.dart called. Then id wil be set after login. So, before login, we set empty map.
f

fresh-football-47124

10/13/2022, 4:53 AM
I have a feeling that it’s not correctly updating the attributes so it’s serving the default value
Can you debug what the
final feature
is set to?
c

cool-apple-97384

10/13/2022, 5:00 AM
Wait, I will try with always setup attributes when load the app
Hi @fresh-football-47124 this is the result
The source name always
defaultValue
Hi @fresh-football-47124 after disabled QA mode, I got different value. Thanks for your support 🙏
f

fresh-football-47124

10/13/2022, 6:02 AM
nice