A user object is required to collect and process users’ phone numbers and WhatsApp opt-ins. Because Insider does not store any personal data on cookies or local storage, you must integrate a user object using Insider Object to gather the information necessary to send messages to your customers over WhatsApp.
The following guide describes integrating user objects for WhatsApp using Insider Object.
Sample code for WhatsApp user object
window.insider_object = {
"user": {
"phone_number": "+120394879878",
"gdpr_optin": true,
"whatsapp_optin": true
}
}Namespace
The code of Insider Object is as follows:
window.insider_object.*Code for user objects must be added under the code for the Insider Object.
User objects for WhatsApp: Properties, definitions, and code
The user object includes the user properties. The user object can be implemented in all cases, including when the user is not logged in. Only the available properties will be filled in when the user is not logged in; keys without values will not be added to the object.
| Key | Type | Definition | Required |
|---|---|---|---|
| phone_number | String | User's phone number in E.164 format (e.g. +6598765432) | Yes |
| whatsapp_optin | Boolean | User's permissions for WhatsApp. | Yes |
| gdpr_optin | Boolean | User's permissions to receive Insider campaigns, or have their data collected and processed. | Yes |
If your company obtains your users' consent in compliance with the local regulations, make sure to pass the GDPR opt-in field to Insider One. If you want to stop collecting and processing the data of an identified user, GDPR opt-in field should have the false value. Insider One cannot be held liable if these obligations are not fulfilled and reserves the right to seek compensation from your company.
Once the user object is integrated into your website, you can provide Insider with the required WhatsApp fields (phone_number, whatsapp_optin, gdpr_optin) whenever a user logs in.
Checklist for any page where the user object is present:
- Object window.insider_object.user returns on the page.
- All properties are filled in when the user logs in.