User Object

Prev Next

Suggested readings: Page object, Listing object, Product object, Basket object, Transaction object

The User Object includes the user properties. This object can be implemented in all cases, including when the user is not logged in. When the user is not logged in, the available properties will be filled, and any keys without values will not be excluded from the object.

This guide answers the following questions:

What are the prerequisites?

  • Insider tag must be implemented.
  • Insider object must be defined before the Insider tag. Otherwise, the Insider tag cannot read any information from the Insider object.

What are the properties?

The User object has the following properties.

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.

KeyPropertyTypeDefinitionRequired
uuidUniversal User IDStringUser's User ID used as an identifier, supplied by the partnerNo
genderGenderStringUser's gender informationNo
birthdayBirthdayDate/TimeUser's birthday in YYYY-MM-DD format (e.g. 1993-03-14).No
has_transactedPurchase InformationBooleanUser's purchase history on the website.
True = previously purchased;
False = never purchased.
No
transaction_countNumber of transactionsNumberUser's total number of transactions on the websiteNo
gdpr_optinGDPR Opt-inBooleanUser's permission for Insider campaigns, data collection and processing:
False = user will not see any Insider campaign or receive any message from any channel;
True or empty = Insider may interact with the user through personalization campaigns
Yes
nameNameStringUser's nameNo
surnameSurnameStringUser's surnameNo
usernameUsernameStringUser's usernameNo
emailEmail AddressStringUser's email address, can be used as an identifierNo
email_optinEmail Opt-inBooleanUser's permission for marketing emails:
True = emails allowed;
False = email not allowed
No
phone_numberPhone NumberStringUser's phone number in E.164 format (e.g. +6598765432), can be used as an identifierNo
sms_optinSMS Opt-inBooleanUser's permission for SMS:
True = SMS allowed;
False = SMS not allowed
No
whatsapp_optinWhatsApp Opt-inBooleanUser's permission for WhatsApp:
True = WhatsApp allowed;
False = WhatsApp not allowed
No
languageLanguageStringUser's preferred language in IETF format (e.g., en_US). Refer to Language Codes for the language list.No
returningReturning VisitorBooleanTrue = returning visitor;
False = new visitor
No
static_segment_id
Static Segment IDNumbers (Number array)Static Segment ID; users are added directlyNo

What are the things to keep in mind?

When integrating the object, the following factors should be considered.

  • You can use uuid, email and phone number keys as identifiers.
  • The gdpr_optin key is required if you are sharing any value for any of the other available keys in this object.
  • This object is required if you want to send messages via Insider's Email, SMS, and WhatsApp products.
  • window.insider_object.user object should return on the page. 
  • All available properties are filled in when the user logs in. 

Sample code

Below is a sample code for the User object.

window.insider_object = window.insider_object || {};
window.insider_object.user = {
      "uuid":"7bacpk03nc",
      "gender":"M",
      "birthday":"1990-01-14",
      "has_transacted":true,
      "transaction_count":2,
      "gdpr_optin":true,
      "name":"John",
      "surname":"Doe",
      "username":"jdoe",
      "email":"jdoe@mailservice.com",
      "email_optin":true,
      "phone_number":"+120394879878",
      "sms_optin":true,
      "whatsapp_optin":true,
      "language":"en_US",
      "returning":true,
      "static_segment_id":[1,3,5],
      "custom": {
            "car_brand": "Mercedes-Benz",
            "car_series": "C",
            "car_model": "200d",
            "car_year": "2018",
            "car_plate": "ABC1234D",
            "car_insurance": True
        }
}

In addition to the properties defined in the table above, you can add custom properties to any object. Such properties should be added under the custom object, as in the example above. 

The key-value pairs under the custom object are attributed as custom user attributes to the user.
The value type of any key under the custom object varies depending on the key. Make sure to add the values in the data type that fits the best.

How can I monitor if it works correctly?

Once you deploy your integration, you can test it via the Website Integration Wizard. This wizard helps you complete your integration and test it afterwards. If you have already implemented the integration, you can use the wizard only to test it as well.