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

brainy-honey-94290

02/15/2023, 6:04 PM
Hello everyone! Do you recommend any tutorial to do my first AB test with reactJS, with self-hosted GB? I’m having a hard time understanding the conversions. I am using
postgres
for the datasource and currently I have only one table (
viewed_experiments
), I have not found information regarding the database schema that should be used. thnks
f

fresh-football-47124

02/15/2023, 6:43 PM
Hi Marcos, how are you tracking the events? Are you using something like Rudderstack?
b

brainy-honey-94290

02/15/2023, 7:14 PM
HI @fresh-football-47124, I don’t understand specifically what you mean, but currently in the frontend I have defined the following:
ExperimentsDomain.saveExperimentData
is a function that sends data to an internal API which saves the data in the postgres table, I’m a bit new to experiments, if I’m doing something wrong I’d appreciate it if you could tell me
Copy code
const growthbook = new GrowthBook({
  apiHost: "<http://localhost:3100>",
  clientKey: "sdk-a",
  enableDevMode: true,
  enabled: true,
  trackingCallback: (experiment, result) => {
    console.log({
      experiment_id: experiment.key,
      variation_id: result.variationId,
      user_id: getKey('user').id
    })
    // TODO: Use your real analytics tracking system
    ExperimentsDomain.saveExperimentData({
      experiment_id: experiment.key,
      variation_id: result.variationId,
      user_id: getKey('user').id
    });
  }
});
15 Views