Email Opt-in Integration

Prev Next

Email integration requires collecting and processing users’ email addresses, GDPR opt-ins, and email opt-ins. With the type: 'user' method, you can pass this information to Insider One. This allows Insider One to identify and unify email users correctly.

This practice ensures data consistency across all user identification and unification scenarios.

The following describes how to configure Email integration using the Insider Queue array via Insider Web SDK.

Sample code for Email User Push

window.InsiderQueue.push({
    type: 'user',
    value: {
        "uuid": "INS123",
        "gdpr_optin": true,        
        "name": "John",
        "surname": "Doe",
        "username": "jdoe",
        "email": "jdoe@useinsider.com",
        "email_optin": true,
        "language": "en_US",
        "custom": {
            "user_lifetime": 23,
            "membership_type": "Silver"
        }        
    }
});

Insider Queue array

The code of Insider Queue Array is as follows:

window.InsiderQueue = window.InsiderQueue || [];

Code for user push must be added under the code for InsiderQueue.

User Push: Properties, definitions, and code

The type: 'user' method includes the user properties. This method can be implemented in all cases, including when the user is not logged in. When the user is not logged in, only the available properties will be filled in; keys without values will not be added.

Attribute

Description

Data Type

Sample Value

Required

gender

Gender of the user. The values can be F or M.

String

M

No

birthday

Birthday of the user

Datetime

1990-01-14

No

name

Name of the user

String

John

No

surname

Surname of the user

String

Doe

No

age

Age of the user

Number

33

No

email

Email address of the user

String

jdoe@useinsider.com

No*

email_optin

Indicates if the user has opted in for emails

Boolean

true

No

phone_number

Phone number of the user in E.164 format

String

+120394879878

No*

sms_optin

Indicates if the user has opted in for SMS

Boolean

true

No

city

City of the user

String

Jakarta

No

country

Country of the user

String

Indonesia

No

uuid

Unique user ID of the user

String

INS123

No*

gdpr_optin

Indicates if the user has allowed for cookies

Boolean

true

No***

whatsapp_optin

Indicates if the user has opted in for WhatsApp messages

Boolean

false

No

custom

Object for custom user attributes

Object

{"membership": "Silver"}

No

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 you push the type: 'user' method, you can provide Insider One with the required email fields (email, gdpr_optin, email_optin) whenever a user:

  • Logs in

  • Subscribes to a newsletter (e.g., through an input box on the footer)

  • Registers by providing their email address (e.g., on the registration page)

- For users whose gdpr_optin field is not defined or is false: The respective field should not be filled in.

- For users whose email_optin field is not defined or is false: The respective field can be filled in only if the gdpr_optin is true. If it is false, users will not receive emails.

If you passed the user’s uuid information while implementing the Insider Web SDK, make sure the information is the same for both.

Checklist for any page where this method is present:

  • window.InsiderQueue.user returns on the page.

  • All properties are filled in when the user logs in.