User Object
  • 22 Feb 2024
  • 3 Minutes to read

    User Object


      Article Summary

      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 the object.

      What are the prerequisites?

      • Insider tag must be implemented.
      • Insider object must be defined before the Insider tag. Otherwise 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. If you want to stop collecting and processing the data of an identified user, GDPR opt-in field should have the false value. Insider 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)No
      returningReturning VisitorBooleanTrue = returning visitor;
      False = new visitor
      No
      list_idNewsletter Contact List IDNumbers (Number array)Newsletter contact list IDs; 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,
            "list_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. 

      Your title goes here
      The key-value pairs under the custom object are attributed as custom user attributes to the user.
      Your title goes here
      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 different methods.

      Insider Object 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. See more on the Insider Object Integration Wizard.

      Browser Test

      You can visit your website and navigate to a page where you want to test the User object.

      1. Right click on your website to inspect the page.
      2. Go to Developer Console.
      3. Run insider_object or insider_object.user to see your object.
      4. Make sure that it follows the criteria stated in the properties.

      Was this article helpful?

      What's Next
      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses