Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/mixpanel-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ var DEFAULT_CONFIG = {
'record_max_ms': MAX_RECORDING_MS,
'record_min_ms': 0,
'record_sessions_percent': 0,
'recorder_src': 'https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js'
'recorder_src': 'https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js',
'max_property_length': 255 //Default is 255, -1: For no truncate
};

var DOM_LOADED = false;
Expand Down Expand Up @@ -877,7 +878,7 @@ MixpanelLib.prototype._encode_data_for_request = function(data) {

// internal method for handling track vs batch-enqueue logic
MixpanelLib.prototype._track_or_batch = function(options, callback) {
var truncated_data = _.truncate(options.data, 255);
var truncated_data = _.truncate(options.data, this.get_config('max_property_length') || 255);
var endpoint = options.endpoint;
var batcher = options.batcher;
var should_send_immediately = options.should_send_immediately;
Expand Down
2 changes: 1 addition & 1 deletion src/mixpanel-people.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ MixpanelPeople.prototype._send_request = function(data, callback) {
callback(-1);
}
}
return _.truncate(date_encoded_data, 255);
return _.truncate(date_encoded_data, this.get_config('max_property_length') || 255);
}

return this._mixpanel._track_or_batch({
Expand Down