You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed mismatch in visits and unique visits on stats page (#22588)
ref https://linear.app/ghost/issue/ANAL-96
- fixed mismatch in visits and unique visits
- moved away from sessions-based materialized views (still hanging
around)
- bounce rate needs revisions
This doesn't quite fix everything, as bounce rate looks off yet. It's
much better than it was and I'll follow up tomorrow/next week with the
rest.
We also need to clean up or consolidate the views, which I need to think
about more before getting rid of what we have.
{% if defined(member_status) %} and member_status IN {{ Array(member_status, "'undefined', 'free', 'paid'", description="Member status to filter on", required=False) }} {% end %}
163
-
{% if defined(device) %} and device = {{ String(device, description="Device to filter on", required=False) }} {% end %}
164
-
{% if defined(browser) %} and browser = {{ String(browser, description="Browser to filter on", required=False) }} {% end %}
165
-
{% if defined(os) %} and os = {{ String(os, description="Operating system to filter on", required=False) }} {% end %}
166
-
{% if defined(source) %} and source = {{ String(source, description="Source to filter on", required=False) }} {% end %}
167
-
{% if defined(location) %} and location = {{ String(location, description="Location to filter on", required=False) }} {% end %}
168
-
{% if defined(pathname) %} and pathname = {{ String(pathname, description="Pathname to filter on", required=False) }} {% end %}
169
-
group by date
116
+
select
117
+
date,
118
+
uniq(session_id) as visits,
119
+
sum(pageviews) as pageviews,
120
+
sum(case when hits_per_session = 1 then 1 else 0 end) / nullIf(uniq(session_id), 0) as bounce_rate,
121
+
avg(latest_view_aux - first_view_aux) as avg_session_sec
{% if defined(member_status) %} and member_status IN {{ Array(member_status, "'undefined', 'free', 'paid'", description="Member status to filter on", required=False) }} {% end %}
126
+
{% if defined(device) %} and device = {{ String(device, description="Device to filter on", required=False) }} {% end %}
127
+
{% if defined(browser) %} and browser = {{ String(browser, description="Browser to filter on", required=False) }} {% end %}
128
+
{% if defined(os) %} and os = {{ String(os, description="Operating system to filter on", required=False) }} {% end %}
129
+
{% if defined(source) %} and source = {{ String(source, description="Source to filter on", required=False) }} {% end %}
130
+
{% if defined(location) %} and location = {{ String(location, description="Location to filter on", required=False) }} {% end %}
131
+
{% if defined(pathname) %} and pathname = {{ String(pathname, description="Pathname to filter on", required=False) }} {% end %}
0 commit comments