File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export function initAutoTrackingCore(lib) {
10
10
ignoreDisabledFormFields : false ,
11
11
ignoreFormFieldTypes : [ 'password' ] ,
12
12
recordClicks : true ,
13
+ recordClicksPositionPointer : false ,
13
14
recordFormSubmits : true ,
14
15
recordPageViews : true ,
15
16
recordPageViewsOnExit : false ,
@@ -196,11 +197,20 @@ export function initAutoTrackingCore(lib) {
196
197
if ( options . recordClicks === true ) {
197
198
utils . listener ( 'a, a *' ) . on ( 'click' , function ( e ) {
198
199
const el = e . target ;
199
- const event = {
200
+ let event = {
200
201
element : helpers . getDomNodeProfile ( el ) ,
201
- local_time_full : new Date ( ) . toISOString ( )
202
+ local_time_full : new Date ( ) . toISOString ( ) ,
202
203
} ;
203
204
205
+ // pointer position tracking
206
+ if ( options . recordClicksPositionPointer === true ) {
207
+ const pointer = {
208
+ x_position : e . pageX ,
209
+ y_position : e . pageY ,
210
+ }
211
+ event = { ...event , pointer} ;
212
+ }
213
+
204
214
if ( options . catchError ) {
205
215
return client
206
216
. recordEvent ( {
You can’t perform that action at this time.
0 commit comments