Skip to content

Commit a07c0ca

Browse files
committed
add screen width to the tracking script
1 parent ca2e05f commit a07c0ca

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tracker/script.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tracker/script.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type Payload = {
1111
url: string;
1212
referrer?: string;
1313
utm?: { campaign?: string; content?: string; medium?: string; source?: string; term?: string };
14+
screen_width?: number;
1415
};
1516

1617
export type EventOptions = {
@@ -107,6 +108,7 @@ export async function event(name: string = "pageview", options?: EventOptions):
107108
source: utm.get("utm_source"),
108109
term: utm.get("utm_term"),
109110
},
111+
screen_width: !noWindow ? window.screen?.width : undefined,
110112
}),
111113
});
112114

0 commit comments

Comments
 (0)