File tree Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Expand file tree Collapse file tree 4 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ type TrackConfig struct {
17
17
Decoder string `json:"decoder"`
18
18
EnableGet bool `json:"enableGet"`
19
19
ResendInterval int `json:"resendInterval"`
20
+ SizeLimit int `json:"sizeLimit"`
20
21
}
21
22
22
23
func ParseTrackConfig (s string ) TrackConfig {
Original file line number Diff line number Diff line change @@ -129,6 +129,9 @@ func DeleteImpressions(websiteId string) bool {
129
129
}
130
130
131
131
func AppendTraceToImpression (id string , trace * Trace ) {
132
+ if len (trace .Events ) == 0 {
133
+ return
134
+ }
132
135
impressionMapMutex .TryLock (id )
133
136
134
137
impression := GetImpression (id )
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ class Config extends React.Component {
62
62
res += `\n frequency: ${ website . trackConfig . frequency } ,` ;
63
63
}
64
64
65
- if ( website . trackConfig . sizeLimit !== 4096 ) {
65
+ if ( website . trackConfig . sizeLimit !== 65535 ) {
66
66
res += `\n sizeLimit: ${ website . trackConfig . sizeLimit } ,` ;
67
67
}
68
68
@@ -101,7 +101,7 @@ class Config extends React.Component {
101
101
var script = document.createElement("script");
102
102
script.src = "https://cdn.jsdelivr.net/npm/mouselog@${ version } /build/mouselog.min.js";
103
103
script.onload = () => {
104
- ${ configText } var agent = new mouselog.Mouselog ();
104
+ ${ configText } var agent = mouselog.init ();
105
105
agent.run(config);
106
106
};
107
107
var t = document.getElementsByTagName("script");
Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ class WebsitePage extends React.Component {
64
64
// Time interval for resending the failed trace data
65
65
resendInterval : 3000 ,
66
66
67
+ // Maximum size of a single package (byte)
68
+ sizeLimit : 65535 ,
69
+
67
70
// Scope
68
71
scope : "window.document"
69
72
}
You can’t perform that action at this time.
0 commit comments