Add screen resolution and tz offset

This commit is contained in:
Mikko Ahlroth 2018-06-26 07:28:17 +03:00
parent ba17fd8cef
commit 5ff8bb3171

View file

@ -10,8 +10,12 @@ defmodule Tilastokeskus.Reception.Routes.PageView do
addr = get_addr(req)
ua = parse_ua(req)
{referrer, referrer_noq, referrer_domain} = parse_referrer(req)
body = URI.decode_query(req.body || "")
{path, path_noq, host} = parse_url(body)
screen_w = Map.get(body, "screen_width")
screen_h = Map.get(body, "screen_height")
tz_offset = Map.get(body, "tz_offset")
# Run in one transaction to avoid multiple DB checkouts
{:ok, response} =
@ -36,7 +40,10 @@ defmodule Tilastokeskus.Reception.Routes.PageView do
ua_version: unknown_2_str(ua.client.version),
os_name: unknown_2_str(ua.os.name),
os_version: unknown_2_str(ua.os.version),
device_type: unknown_2_str(ua.device.type)
device_type: unknown_2_str(ua.device.type),
screen_w: screen_w,
screen_h: screen_h,
tz_offset: tz_offset
}
)