File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -171,13 +171,13 @@ Autocapture.prototype.trackDomEvent = function(ev, mpEventName) {
171
171
Autocapture . prototype . initClickTracking = function ( ) {
172
172
window . removeEventListener ( EV_CLICK , this . listenerClick ) ;
173
173
174
- if ( ! this . getConfig ( CONFIG_TRACK_CLICK ) ) {
174
+ if ( ! this . getConfig ( CONFIG_TRACK_CLICK ) && ! this . mp . get_active_record_capture_interactions ( ) ) {
175
175
return ;
176
176
}
177
177
logger . log ( 'Initializing click tracking' ) ;
178
178
179
179
this . listenerClick = window . addEventListener ( EV_CLICK , function ( ev ) {
180
- if ( ! this . getConfig ( CONFIG_TRACK_CLICK ) ) {
180
+ if ( ! this . getConfig ( CONFIG_TRACK_CLICK ) && ! this . mp . get_active_record_capture_interactions ( ) ) {
181
181
return ;
182
182
}
183
183
this . trackDomEvent ( ev , MP_EV_CLICK ) ;
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ var DEFAULT_CONFIG = {
152
152
'record_mask_text_selector' : '*' ,
153
153
'record_max_ms' : MAX_RECORDING_MS ,
154
154
'record_min_ms' : 0 ,
155
+ 'record_capture_interactions' : false ,
155
156
'record_sessions_percent' : 0 ,
156
157
'recorder_src' : 'https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js'
157
158
} ;
@@ -487,6 +488,13 @@ MixpanelLib.prototype.resume_session_recording = function () {
487
488
}
488
489
} ;
489
490
491
+ MixpanelLib . prototype . get_active_record_capture_interactions = function ( ) {
492
+ if ( this . _recorder ) {
493
+ return this . _recorder [ 'getActiveReplayId' ] ( ) && this . get_config ( 'record_capture_interactions' ) ;
494
+ }
495
+ return false ;
496
+ } ;
497
+
490
498
MixpanelLib . prototype . get_session_recording_properties = function ( ) {
491
499
var props = { } ;
492
500
var replay_id = this . _get_session_replay_id ( ) ;
@@ -1842,7 +1850,7 @@ MixpanelLib.prototype.set_config = function(config) {
1842
1850
}
1843
1851
Config . DEBUG = Config . DEBUG || this . get_config ( 'debug' ) ;
1844
1852
1845
- if ( 'autocapture' in config && this . autocapture ) {
1853
+ if ( ( 'autocapture' in config || this . get_config ( 'record_capture_interactions' ) ) && this . autocapture ) {
1846
1854
this . autocapture . init ( ) ;
1847
1855
}
1848
1856
}
You can’t perform that action at this time.
0 commit comments