Hiya, I have a problem with my experiment and I'm sure I'm missing something basic in the setup. The...
b
Hiya, I have a problem with my experiment and I'm sure I'm missing something basic in the setup. The analysis is missing users that do not have the "user_gender" property. But I can't find anywhere in my experiment or metric that specifies a filter on gender. I can see it in the SQL query for the experiment, which starts like this:
WITH
__rawExperiment AS (
SELECT
user_id as user_id,
TIMESTAMP_MICROS(event_timestamp) as timestamp,
experiment_id_param.value.string_value AS experiment_id,
<http://variation_id_param.value.int|variation_id_param.value.int>_value AS variation_id,
user_properties_param.value.string_value AS gender,
geo.country as country,
traffic_source.source as source,
traffic_source.medium as medium,
device.category as device,
device.web_info.browser as browser,
device.operating_system as os
FROM
(
SELECT
*
FROM
``analytics_209649058`.`events_*``
WHERE
_TABLE_SUFFIX BETWEEN '20240619' AND '20240619'
UNION ALL
SELECT
*
FROM
``analytics_209649058.events_intraday_*``
WHERE
_TABLE_SUFFIX BETWEEN '20240619' AND '20240619'
),
UNNEST (event_params) AS experiment_id_param,
UNNEST (event_params) AS variation_id_param,
UNNEST (user_properties) AS user_properties_param
WHERE
event_name = 'experiment_viewed'
AND experiment_id_param.key = 'experiment_id'
AND variation_id_param.key = 'variation_id'
AND user_properties_param.key = 'user_gender'
AND user_id is not null
),
If I remove the line
AND user_properties_param.key = 'user_gender'
and run the query in BigQuery, then I see the expected results. But I can't work out how to remove the user_gender reference in the experiment query? Grateful for any help! I've looked through all the settings and can't see where user_gender is being specified. I checked custom filters, see screenshot, but it doesn't look as though gender is selected as a filter.
f
It seems that gender is not being set for every user
so the where clause is likely filtering all those events out
additional fields like this on the assignment query, are used for dimensional analysis
if this is not always set on exposure, you can (and should) remove it or move it to a separate query on the dimensions page
b
Thank you @fresh-football-47124, yes that is what's happening. But I can't edit the experiment query. How can I remove the gender field?
This is my User Dimensions query and it doesn't include gender: select
parse_date('%Y%m%d',event_date) as date,
user_id,
user_properties.value.string_value as value
FROM (
`SELECT * FROM
analytics_209649058
.`events_*``
WHERE _TABLE_SUFFIX BETWEEN '{{startYear}}{{startMonth}}{{startDay}}' AND '{{endYear}}{{endMonth}}{{endDay}}'
UNION ALL
`SELECT * FROM `analytics_209649058.events_intraday_*``
),
unnest(user_properties) as user_properties
where
user_properties.key = 'company_name'
and user_properties.value.string_value is not null
Basically, I can't find anywhere in the GrowthBook interface where gender is included, it seems to be automatic and unchangeable?
Another odd thing is that gender appears in the dimensions dropdown, but it is not selected, and it is not defined as a dimension in Dimensions. The only User Dimension I have is Company Name. I've tried creating a new experiment from scratch, but I see the same problem. I'm really stuck here!
f
You edit the assignment query, which is in the data sources
🎉 1
b
AHHHH! I didn't recognise "Customise SQL" as being the magic button I needed to edit the SQL
OK, that's interesting. I assume there is some way to change the SQL so that it will return a field such as gender if it is present, but not filter out results that are missing that field. But that's a general SQL question and I can work that out in my own time.
THANK YOU
I think this is perhaps an example of how even small inconsistencies can confuse people...I've been round and round the interface looking for how to edit this query, but was looking for an edit icon, also I'd forgotten that this part of the Experiment query comes from the data source. Phew!