AE JS Settings Reference
This article provides a reference of all the available AE JS settings. Settings can be configured via the settings
property on the returned aeJS
object.
For example, if you wanted to enable the auth_window
setting, you could add this JavaScript:
aeJS.settings['auth_window'] = true;
Table Of Contents
- auth_window
- activity_sharing_enabled
- close_button
- date_format
- default_flow_handlers
- display_error_message
- email_format
- extra_fields
- extra_fields_screen
- extra_info
- flow_css
- flow_text
- hide_email_form
- language
- no_email
- minimum_age
- mobile_detect
- optins
- partner_code
- partner_id
- refresh_demographics
- return_url
- scopes
- services
- social_first
- sso
- verify_email
- verify_email_for_login
- show_latest_activity
- show_latest_activity_for
auth_window
Expects a boolean.
When false
, this setting redirects users to a new page during for the AE Connect registration flow. When true
, the registration flow occurs in a pop-up modal window.
The default value is false
.
activity_sharing_enabled
Expects a boolean.
When false
, this setting will exclude newly registered users from sharing their activity data for analytics and segmentation. Developers may still use the credentials provided after registration to perform their own actions on related service APIs (eg Twitter, Spotify, etc).
The default value is true
.
close_button
Expects a boolean.
This settings determines whether to show a close button or link in top-right corner of the modal pop-up. Clicking outside of the modal will still close window.
The default value is false
.
Note that this setting requires that the auth_window
setting uses modal pop-up windows. This is its default setting.
date_format
Expects a string: either MM-DD-YYYY or DD-MM-YYYY.
Sets the date format in date fields. This is used in conjunction with extra fields forms (the extra_fields
setting). Date fields are generally used for birth dates.
The default value is DD-MM-YYYY
.
default_flow_handlers
Expects a boolean.
When false, this setting disables all built-in modal or redirect flows. Instead developers should listen and handle events using the onFlow event handler.
The default value is true (enabled).
display_error_message
Expects a boolean.
If true
, AE Connect's default flow error messaging is turned on.
The default value is true
.
email_format
Expects an object.
An object which customizes the look of the any emails sent due to framework authentication flow. For example, the email verification email or a password reset email.
The following properties are available:
-
background_color
-
font_size
-
font_family
-
font_color
-
show_header
-
header_background_color
-
header_font_color
-
image_url
-
show_footer
-
footer_background_color
-
footer_font_color
-
logo_link
-
logo_img_url
-
copyright
-
reset_pw_email_subject
-
reset_pw_email_message
-
verify_email_subject
-
verify_email_message
-
reset_pw_email_link
-
verify_email_link
The default value is null
.
extra_fields
Expects an object.
An object that defines any additional fields that should be captured during registration. This setting requires that you also set the extra_fields_screen
setting.
The following fields that can be specified:
-
firstname
-
surname
-
email
-
password
-
address
-
addressline2
-
city
-
state
-
country
-
postcode
-
homephone
-
mobilephone
-
username
-
website
-
bio
-
gender
-
birthdate
Each field takes four optional properties:
-
required
: Boolean. The default value isfalse
. -
required_message
: String. Overrides AE JS's default message. -
error_message
: String. Overrides AE JS's default message. -
label
: String. Overrides AE JS's default label value.
Here's an example of how you could implement the extra_fields
setting with a custom email
field and a birthdate
field with the defaults:
aeJS.settings['extra_fields'] = {
email: {
"label": "enter email",
"required": true,
"required_message": "some message",
"error_message": "some error"
},
birthdate
}
Note that any message or label values that you provide override your language setting.
The default value is null
.
extra_fields_screen
Expects a string: before, after, or disabled.
This setting determines at what point in the registration flow that the extra_fields
form should be presented to user.
The default value is disabled
.
extra_info
Expects an object.
An object that specifies any additional information that should be injected into the authentication flow. Note that you can handle this via AE data tags instead.
The available steps for information insertion include the following:
-
global
-
login
-
register
-
required
(for extra fields) -
recover_password
-
reset_password
-
reset_password_ok
-
verify_email
-
verify_email_ok
Each insertion can be positioned as either top
or bottom
.
Each insertion contains additional information consisting of a title and associated content. Here's an example:
aeJS.settings['extra_info'] = {
global: {
'top': {
'text' : "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed justo risus, tristique at bibendum vitae, vulputate at nibh. Nam condimentum consequat pharetra. Mauris ex erat, pretium ut tincidunt ut, luctus at tellus.",
'title' : 'Global Top Title'
}
}
The default value is null
.
flow_css
Expects a URL.
An absolute URL to a CSS file that should be applied to the registration flow. See our CSS styling guide for further information.
The default value is null
.
flow_text
Expects an object.
Object that specifies text overrides for headers, messages, and buttons displayed during the AE Connect authentication flow.
The following overrides are available:
-
error_header
-
login_header
-
register_header
-
add_info_header
-
add_info_button
-
reset_pw_header
-
reset_pw_sent
-
reset_pw_instructions
-
reset_pw_button
-
reset_pw_confirm_header
-
reset_pw_confirm_button
-
reset_pw_confirm_instructions
-
reset_pw_done_header
-
reset_pw_done_message
-
reset_pw_done_button
-
verify_email_header
-
verify_email_sent
-
verify_email_instructions
-
verify_email_retry_button
-
verify_email_success_header
-
verify_email_success_message
-
verify_email_success_button
-
verify_email_error_header
-
verify_email_error_message
-
forgot_password_link
-
recover_password_link
-
have_account_link
-
need_help_link
-
create_account_link
Here's an example of usage:
aeJS.settings['flow_text'] = {
error_header: 'Sorry, there seems to be a problem',
login_header: 'Sign In',
register_header: 'Sign Up',
verify_email_retry_button: 'Retry',
need_help_link: 'need help?'
}
The default value is null
.
hide_email_form
Expects a boolean.
When true
, this setting hides the inline email registration option and presents it as a button that triggers the display of form.
The default value is false
.
language
Expects a string with a language code.
This setting specifies the language to use for error messages for each extra_fields
capture.
Use the code value for the associated language:
- English —
en_US
- Albanian —
sq_AL
- Arabic —
ar_MA
- Basque —
eu_ES
- Belgium (French) —
be_FR
- Belgium (Netherland) —
be_NL
- Bulgarian —
bg_BG
- Catalan —
ca_ES
- Chilean Spanish —
es_CL
- Chinese —
zh_CN
- Czech —
cs_CZ
- Danish —
da_DK
- Dutch (Netherland) —
nl_NL
- Finnish —
fi_FI
- French —
fr_FR
- German —
de_DE
- Greek —
gr_EL
- Hebrew —
he_IL
- Hindi —
hi_IN
- Hungarian —
hu_HU
- Indonesian —
id_ID
- Italian —
it_IT
- Japanese —
ja_JP
- Norwegian —
no_NO
- Persian (Farsi) —
fa_IR
- Polish —
pl_PL
- Portuguese (Brazil) —
pt_BR
- Portuguese (Portugal) —
pt_PT
- Romanian —
ro_RO
- Russian —
ru_RU
- Serbian —
sr_RS
- Slovak —
sk_SK
- Spanish —
es_ES
- Swedish —
sv_SE
- Taiwanese —
zh_TW
- Thai —
th_TH
- Turkish —
tr_TR
- Ukrainian —
ua_UA
- Vietnamese —
vi_VN
The default value is en_US
.
no_email
Expects a boolean.
When true
, this settings hides email registration as an option in authentications flows triggered by ae-data-login-window
or ae-data-register-window
.
The default value is false
.
minimum_age
Expects an integer.
Enables an age verification check. Note that in order to use this setting, the birthdate
field must be specified as a required field.
The default value is null
.
mobile_detect
Expects a boolean.
If true
, this setting enables AE JS's mobile detection. If a mobile device is detected, then this will override the auth_window
setting and force the web browser redirect flow.
Note that there is an onMobileDetect
event you can use to perform custom action upon page load if required. This event will fire regardless of the mobile_detect
setting.
The default value is true
.
optins
Expects an array.
This setting takes an array of object settings that define each opt-in option to be presented in the modal or redirect window for registration and login.
Opt-ins are shown as checkboxes prior to login or registration.
The following object fields can be used:
-
label
: The text to show next to a checkbox. -
brandid
(optional): Brand ID for a specific brand's newsletter or group. -
segmentid
(optional): Segment ID for a specific segment's newsletter or group.
If no brandid
or segmentid
is provided, the user will be opted into a global newsletter or group for your account.
Here is an example of usage:
aeJS.settings['optins'] = [
{
label: 'Universal Access',
checked: true
},
{
label: 'Nike',
brandid: 123
},
{
label: 'Streaming News',
segmentid: 123,
checked: false
},
];
The default value is null
.
partner_code
Expects a string.
A code that identifies external system associated with any registration performed by local framework.
The default value is null
.
partner_id
Expects a string.
The external user ID associated with any registration performed by local framework. Requires partner_code
.
For example, your CMS may have a user ID for the logged in user.
The default value is null
.
refresh_demographics
Expects a boolean.
Determines whether the most recent social network demographics will override existing user data on login. For example, the birthdate
field.
The default value is true
.
return_url
Expects a URL.
This setting specifies the global setting for any return URLs. If not set, the return_url
defaults to the active URL when a link or form is triggered with an AE data tag.
This setting is always overridden by anydata-ae-return
attributes.
The default value is null
.
NOTE: This setting only works if auth_window=false
scopes
Expects an object.
An object that specifies a sub-set of service-specific permissions. These are presented to a user during authentication. They must be a sub-set of permissions already available to the service application. For example, Facebook app permissions.
Here is an example of usage:
aeJS.settings['scopes'] = {
facebook: 'email, user_actions.music',
twitter: 'read',
qq: 'get_user_info',
weibo: 'email',
deezer: 'basic_access',
spotify: 'playlist-read-private'
}
The default value is null
.
services
Expects a string.
This setting takes a comma-separated list of services to offer for registration. This must be a sub-set of the full list of services configured in your AE dashboard. Services will be displayed in the order provided here.
The following services can be specified in the list:
-
facebook
-
twitter
-
youtube
-
google
-
instagram
-
tumblr
-
soundcloud
-
lastfm
-
foursquare
-
spotify
-
deezer
-
napster
-
kakao
-
weibo
-
qq
-
none
A setting of none
shows no configured registration options. When doing custom development, this setting will prevent registration on services not explicitly set. To allow all, leave blank.
Here's an example of usage:
<pre><code>aeJS.settings['services'] = "facebook, twitter";</code></pre>
The default value is null
.
social_first
Expects a boolean.
If true
, social icons will be displayed before email registration and login form.
The default value is true
.
sso
Expects a string.
Scope determines whether a user will be automatically signed-in or registered (if sessions available).
Valid options are:
-
application
-
local
application
If this setting is set to application
, a user previously registered on the domain, and a user session exists, AE JS will fire an onUser
event.
If the user previously registered on the domain, and a user session does not exist, AE JS will fire an onLogin
event with a state of login
when the user signs in.
If user has not previously registered on the domain, AE JS attempts to automatically log the user in if they have previously signed in on any domain with the included framework. If successful, an onLogin
event will be fired with
a state of registration
and the sso
parameter as true
.
In order to succeed, a user must meet the criteria of the current domain's AE JS settings. They must have used a service enabled for the current site, have provided all required fields, and verified their email if required to, etc. If the
user does not meet all of the requirements, they must explicitly register.
local
If the user previously registered on the domain, AE JS will fire an onUser
event. If not, the user must explicitly register.
The default value is application
.
verify_email
Expects a boolean.
If true
, a confirmation email is sent to verify the registered email address during the registration flow. An automated verification URL and screen are provided.
The default value is false
.
verify_email_for_login
Expects a boolean.
This setting ensures that the user has a verified email before it triggers login for framework.
show_latest_activity
Expects an integer (Activity ID).
Check for the most recent occurance of the activity by this member. The results will be shown in the user.actions property of the returned user object in onLogin event, etc. Can be used in combination with 'show_latest_activity-for'.
show_latest_activity_for
Expects an integer (Brand ID).
Check for the most recent occurance of activity done for this brand by this member. The results will be shown in the user.actions property of the returned user object in onLogin event, etc. Can be used in combination with 'show_latest_activity'.