Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tilastokeskus
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikko Ahlroth
tilastokeskus
Commits
2da24fd8
Commit
2da24fd8
authored
Jun 29, 2018
by
Mikko Ahlroth
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:Nicd/tilastokeskus
parents
e04db804
fd80c46c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
page_view.ex
lib/reception/routes/page_view.ex
+3
-3
track.js
static/track.js
+5
-0
No files found.
lib/reception/routes/page_view.ex
View file @
2da24fd8
...
...
@@ -17,7 +17,7 @@ defmodule Tilastokeskus.Reception.Routes.PageView do
addr
=
get_addr
(
req
)
ua
=
parse_ua
(
req
)
{
referrer
,
referrer_noq
,
referrer_domain
}
=
parse_referrer
(
req
)
{
referrer
,
referrer_noq
,
referrer_domain
}
=
parse_referrer
(
body
)
screen_w
=
Map
.
get
(
body
,
"
screen_width"
)
screen_h
=
Map
.
get
(
body
,
"
screen_height"
)
...
...
@@ -145,8 +145,8 @@ defmodule Tilastokeskus.Reception.Routes.PageView do
|>
UAInspector
.
parse
()
end
defp
parse_referrer
(
req
)
do
referrer
=
Raxx
.
get_header
(
req
,
"
referer"
,
nil
)
defp
parse_referrer
(
body
)
do
referrer
=
Map
.
get
(
body
,
"
referrer"
)
case
referrer
do
nil
->
...
...
static/track.js
View file @
2da24fd8
...
...
@@ -122,6 +122,10 @@ SOFTWARE.
data
.
tz_offset
=
(
new
Date
()).
getTimezoneOffset
();
data
.
url
=
window
.
location
.
href
;
if
(
'referrer'
in
document
&&
document
.
referrer
!=
null
)
{
data
.
referrer
=
document
.
referrer
;
}
var
data_parts
=
[];
function
add_part
(
source
,
key
,
parts
)
{
...
...
@@ -132,6 +136,7 @@ SOFTWARE.
add_part
(
data
,
'screen_height'
,
data_parts
);
add_part
(
data
,
'tz_offset'
,
data_parts
);
add_part
(
data
,
'url'
,
data_parts
);
add_part
(
data
,
'referrer'
,
data_parts
);
var
data_str
=
data_parts
.
join
(
'&'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment