Hi folks, we’re trying to setup our first metric a...
# ask-questions
h
Hi folks, we’re trying to setup our first metric and kick the tires on growthbook. Our particular integration is going to use BQ. None of our columns are INT so we get an error on the SUM when trying to configure the metric. All our columns are string or timestamp. Is this a situation you’ve run into before and can provide some guidance on? Basically we want this metric to measure against the total number of event clicks on a button.
f
If you want to count the number of rows for each user, you can select a hard-coded integer:
SELECT 1 as value, ...
That will give each event a value of 1 and then when we aggregate by user, we will sum those together to get a count
h
Nice that works perfectly. So to be clear with this method a user would only be tracked once regardless of how many times they’ve clicked the button?
f
if you just want to track the percent of users who converted, you would choose the metric type
binomial
. If you choose that, you don't need to select a
value
column at all. If you wanted to count the average number of button clicks per user, you would choose the metric type
count
and use a hard-coded value like above
h
@microscopic-lock-65996 see above ^
m
Thanks @future-teacher-7046!
What about a total count of clicks? Or would we want binomial and let the stats engine do its thing
f
total counts don't usually work very well since the variations might not have exactly equal sample sizes. You typically want to compare per-user values instead
👍 2
m
@future-teacher-7046 @fresh-football-47124 Hey guys, Drew saw this and we realized we don't have an
experiment_id
field in BQ. Do we need to set this manually in Segment? Also, I think I remember that we need to set a custom event in each variation -- I am having trouble finding that in the documentation. Do either of you know where I might look to learn more?
f
if you're using our SDK, you would fire the segment call inside the tracking callback: https://docs.growthbook.io/lib/js#tracking-callback
👍 1
f
You would fire a brand new segment event called "viewed experiment" or something similar that has the experiment id and which variation they saw.
👍 1
m
Hey guys, our experiment is running but we're having trouble accessing results. Do we need to update our BQ schema to include an experiment_id column?
f
You shouldn't need to touch the BigQuery schema yourself. Segment handles all of that for you. It can take an hour or two for Segment data to show up in a warehouse though
You can use the Segment Debugger to see if the event is firing in realtime
m
Thanks Jeremy, we are seeing this error:
h
According to segment we are tracking properly.
f
can you paste the schema or sample from "datastax-datalake.www.tracks_view"
h
f
When did you first start firing that event with the
experimentId
attribute?
h
I’m not 100% sure this is where I should be looking for the
experiment_id
column, but I’ve been scanning several other tables and don’t see it in them either. We started firing that event about 2 hours ago
f
oh wait, I see the problem
Segment creates a new table for every event type
So you should see a table in BigQuery called
experiment_viewed
h
I don’t see that, but maybe there is a bit of a delay in that showing up?
f
do you see other event-specific tables in BigQuery?
h
yea we have several of them
f
ok, it's possible Segment hasn't synced the new table yet. I think there's a way to view a history of data warehouse syncs in the Segment dashboard
h
yep thats a good point, last sync was 5 hours ago. so we’ll sit tight and see if it works after the next sync. thanks for the help