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

bitter-advantage-46115

10/10/2022, 8:14 PM
Hi All, I just starting with Growthbook and I'm impressed so far. The feature flags are great and really easy to use. Now I'm experimenting with Experiments, using just a vanilla postgres database where we keep a lot of our metrics. My question is: If it's not hooked up to any canned analytics engine, are there some docs on creating a basic schema. For example if I try and create a new experiment it tries to import and throws a
relation "viewed_experiment" does not exist
error. Also I'm trying to figure out where the Logged-in users assignment table is.
f

future-teacher-7046

10/10/2022, 8:15 PM
Hi Dan. If you go to Analysis -> Data Sources in the left nav and select the data source you added, you'll see all of the assignment queries. We auto-generate some generic SQL there, but you can go in and edit it as needed.
For docs, we have a section on creating custom schemas - https://docs.growthbook.io/app/datasources#custom-schemas
b

bitter-advantage-46115

10/10/2022, 8:20 PM
Thanks, that's really helpful. I'll dig into the docs. With the example in the docs
Copy code
SELECT
  user_id,
  received_at as timestamp,
  experiment_id,
  variation_id
FROM
  events
WHERE
  event_type = 'viewed experiment'
We would want to insert a row in the events table the first time a user gets assigned to a experiment variation?
f

future-teacher-7046

10/10/2022, 8:20 PM
Ideally, you would insert a new row every time the user views the experiment. So if they came back 3 days later and viewed it again, that would be a new row
b

bitter-advantage-46115

10/10/2022, 8:21 PM
ok great, thanks
30 Views