Comparing version 1.8.0 to 1.9.0
{ | ||
"name": "zmp-ga4", | ||
"version": "1.8.0", | ||
"version": "1.9.0", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Nguyễn Hồng Phát", |
@@ -85,2 +85,5 @@ "use strict"; | ||
window.addEventListener("beforeunload", this.collect); | ||
this.referer = new URLSearchParams(location.search).get("utm_source"); | ||
this.screenResolution = "".concat(screen.width, "x").concat(screen.height); | ||
this.viewportSize = "".concat(window.innerWidth, "x").concat(window.innerHeight); | ||
var handleLocationChange = function () { | ||
@@ -188,3 +191,3 @@ var match = /\/zapps\/\d+\/?(.*)/.exec(location.pathname); | ||
name: action, | ||
params: __assign({ session_id: this.sessionId, engagement_time_msec: String(Math.round(performance.now() - this.startTime)), protocol: location.protocol }, params) | ||
params: __assign({ session_id: this.sessionId, engagement_time_msec: String(Math.round(performance.now() - this.startTime)), protocol: location.protocol, user_agent: navigator.userAgent, document_referrer: this.referer, screen_resolution: this.screenResolution, viewport_size: this.viewportSize }, params) | ||
}); | ||
@@ -191,0 +194,0 @@ clearTimeout(this.timeout); |
@@ -10,2 +10,5 @@ export class AdaptiveAnalytics { | ||
private timeout: number; | ||
private referer: string; | ||
private screenResolution: string; | ||
private viewportSize: string; | ||
@@ -28,2 +31,5 @@ constructor( | ||
window.addEventListener("beforeunload", this.collect); | ||
this.referer = new URLSearchParams(location.search).get("utm_source"); | ||
this.screenResolution = `${screen.width}x${screen.height}`; | ||
this.viewportSize = `${window.innerWidth}x${window.innerHeight}`; | ||
@@ -159,2 +165,6 @@ const handleLocationChange = () => { | ||
protocol: location.protocol, | ||
user_agent: navigator.userAgent, | ||
document_referrer: this.referer, | ||
screen_resolution: this.screenResolution, | ||
viewport_size: this.viewportSize, | ||
...params, | ||
@@ -161,0 +171,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18337
382