Identify a user
To fully harness the potential of In-App Messaging, you must segment and target your In-App Messaging campaigns to specific user subsets. By identifying users with additional information, including their device demographics, location and any attributes of your choosing, you will be able to display intelligent, targeted in-app messages to the right users.
1const userInfo = {2 attributes: {3 // E.g. hobbies: ['cooking', 'knitting'],4 },5 demographic: {6 appVersion: '',7 locale: '', // E.g. en_US8 make: '', // E.g. Apple9 model: '', // E.g. iPhone10 modelVersion: '', // E.g. 1311 platform: '', // E.g. iOS12 platformVersion: '', // E.g. 1513 timezone: '' // E.g. Americas/Los_Angeles14 },15 location: {16 city: '', // E.g. Seattle17 country: '', // E.g. US,18 postalCode: '', // E.g. 9812119 region: '', // E.g. WA20 latitude: 0.0,21 longitude: 0.022 },23 metrics: {24 // E.g. logins: 15725 }26};27
28await InAppMessaging.identifyUser('some-user-id', userInfo);
Identify a user with Amazon Pinpoint
When using identifyUser
with Amazon Pinpoint, you can configure the address
and optOut
properties in addition to the other user info properties.
1const userInfo = {2 address: '' // E.g. A device token or email address3 optOut: '' // Either ALL or NONE4};5
6await InAppMessaging.identifyUser('some-user-id', userInfo);