File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ export function trackEvent(eventName: string, data = {}) {
8
8
attributes : {
9
9
'analytics.source' : 'tracking' ,
10
10
'analytics.type' : 'event' ,
11
+ 'screen.width' : window . innerWidth ,
12
+ 'screen.height' : window . innerHeight ,
13
+ 'screen.aspect_ratio' : ( window . innerWidth / window . innerHeight ) . toFixed (
14
+ 2
15
+ ) ,
11
16
...data ,
12
17
timestamp : new Date ( ) . toISOString ( ) ,
13
18
} ,
@@ -26,6 +31,11 @@ export function trackPageView(pageName: string, data = {}) {
26
31
'analytics.type' : 'page_view' ,
27
32
'page.name' : pageName ,
28
33
'action.type' : 'navigation' ,
34
+ 'screen.width' : window . innerWidth ,
35
+ 'screen.height' : window . innerHeight ,
36
+ 'screen.aspect_ratio' : ( window . innerWidth / window . innerHeight ) . toFixed (
37
+ 2
38
+ ) ,
29
39
...data ,
30
40
timestamp : new Date ( ) . toISOString ( ) ,
31
41
} ,
You can’t perform that action at this time.
0 commit comments