Skip to content

Commit d06f5c6

Browse files
authored
feat: Mobile device model support (#425)
1 parent f3f3245 commit d06f5c6

File tree

4 files changed

+133
-131
lines changed

4 files changed

+133
-131
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"main": "amplitude.umd.js",
1616
"dependencies": {
17-
"@amplitude/ua-parser-js": "0.7.24",
17+
"@amplitude/ua-parser-js": "0.7.25",
1818
"@amplitude/utils": "^1.0.5",
1919
"blueimp-md5": "^2.10.0",
2020
"query-string": "5"

src/amplitude-client.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,8 @@ AmplitudeClient.prototype._logEvent = function _logEvent(
12601260

12611261
const osName = this._ua.browser.name;
12621262
const osVersion = this._ua.browser.major;
1263-
const deviceModel = this._ua.os.name;
1263+
const deviceModel = this._ua.device.model || this._ua.os.name;
1264+
const deviceVendor = this._ua.device.vendor;
12641265

12651266
userProperties = userProperties || {};
12661267
var trackingOptions = { ...this._apiPropertiesTrackingOptions };
@@ -1280,6 +1281,7 @@ AmplitudeClient.prototype._logEvent = function _logEvent(
12801281
os_name: _shouldTrackField(this, 'os_name') ? osName || null : null,
12811282
os_version: _shouldTrackField(this, 'os_version') ? osVersion || null : null,
12821283
device_model: _shouldTrackField(this, 'device_model') ? deviceModel || null : null,
1284+
device_manufacturer: _shouldTrackField(this, 'device_manufacturer') ? deviceVendor || null : null,
12831285
language: _shouldTrackField(this, 'language') ? this.options.language : null,
12841286
api_properties: apiProperties,
12851287
event_properties: utils.truncate(utils.validateProperties(eventProperties)),

0 commit comments

Comments
 (0)