mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 01:54:34 +03:00
Update session screen_size if unknown (#1610)
This commit is contained in:
parent
69576aa253
commit
8077671f8a
@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Subscribed users can see their Paddle invoices from the last 12 months under the user settings
|
||||
- Allow custom styles to be passed to embedded iframe plausible/analytics#1522
|
||||
- New UTM Tags `utm_content` and `utm_term` plausible/analytics#515
|
||||
- If a session was started without a screen_size it is updated if an event with screen_size occurs
|
||||
|
||||
### Fixed
|
||||
- UI fix where multi-line text in pills would not be underlined properly on small screens.
|
||||
|
@ -91,6 +91,8 @@ defmodule Plausible.Session.Store do
|
||||
duration: Timex.diff(event.timestamp, session.start, :second) |> abs,
|
||||
pageviews:
|
||||
if(event.name == "pageview", do: session.pageviews + 1, else: session.pageviews),
|
||||
screen_size:
|
||||
if(session.screen_size == "", do: event.screen_size, else: session.screen_size),
|
||||
events: session.events + 1
|
||||
}
|
||||
end
|
||||
|
@ -70,7 +70,8 @@ defmodule Plausible.Session.StoreTest do
|
||||
domain: event1.domain,
|
||||
user_id: event1.user_id,
|
||||
name: "pageview",
|
||||
timestamp: timestamp
|
||||
timestamp: timestamp,
|
||||
screen_size: "Desktop"
|
||||
)
|
||||
|
||||
Store.on_event(event1, nil, store)
|
||||
@ -80,6 +81,7 @@ defmodule Plausible.Session.StoreTest do
|
||||
assert session.duration == 10
|
||||
assert session.pageviews == 2
|
||||
assert session.events == 2
|
||||
assert session.screen_size == "Desktop"
|
||||
end
|
||||
|
||||
test "calculates duration correctly for out-of-order events", %{store: store} do
|
||||
|
Loading…
Reference in New Issue
Block a user