orange-train-51512/20/2021, 11:39 AM
In my data source configuration, I already have some user properties that are used in the experiment analysis and are pageview-level. Wouldn't it make sense to have user properties as a part of the pageview query?
JOIN segment s ON (s.user_id = u.user_id)
In which case it would me much easier to calculate the estimates for an experiment based on pageviews by just filtering pageviews with certain user properties. Looks like I can achieve more precision by editing this query
SELECT user_id, timestamp, url, has_orders, lang, country FROM pageviews
When I change <= to simple "=" , I only join user properties which were observed exactly on viewing specific page and not before that.
SELECT u.user_id, MIN(u.conversion_end) AS conversion_end, MIN(u.session_start) AS session_start, MIN(u.actual_start) AS actual_start FROM __users u JOIN segment s ON (s.user_id = u.user_id) WHERE s.date <= u.actual_start GROUP BY u.user_id
orange-train-51512/20/2021, 6:58 PM