Was this article helpful?

Global Conf

Last modified 16:33, 5 Oct 2014

Description

This object represents a site's basic Gigya configuration. This object is a JSON object that sets global Gigya variables before loading gigya.js. This allows the variables to be used when initializing socialize. The stored global configuration parameters that are set in this object are common to all the Gigya API calls on that page. If you define this object, it should be created once, using the following syntax:

<script type="text/javascript" src="http://cdn.gigya.com/js/gigya.js?apiKey=INSERT-YOUR-APIKEY-HERE">
{
  autoLogin: true,
  enabledProviders: 'facebook,twitter'
}
</script>

Note that autoLogin and enabledProviders are only examples of variables that can be set here.

Another option to set the global configuration object with a global variable, instead of the inner text of gigya.js script tag:

window.__gigyaConf = {enabledProviders:'facebook,twitter'};
 
Note: If you choose to set the global configuration object with a global variable, you must declare it before the gigya.js script is loaded.

 

Data Members

Required Field Name Type Description
Optional APIKey string The application key associated with the calling application. An API Key may be obtained from the Site Dashboard page on Gigya's website.
  actionCounterPath string For use by customers implementing Signals and monitoring Page views. For an example of using actionCounterPath see Top Content configuration in Consumer Insights. The actionCounterPath must start with a forward slash "/" (representing the 'root') and can be set to "path" values that were registered on the Signals page or through accounts.registerCountersSetting an actionCounterPath automates page view counting: there is no need to call accounts.incrementCounters (gigya.js must be included in the page)
  cid string A string of maximum 100 characters length. The CID sets categories for transactions that can be used later for filtering reports generated by Gigya in the "Context ID" combo box. The CID allows you to associate the report information with your own internal data. For example, to identify a specific widget or page on your site/application. You should not define more than 100 different context IDs.
  connectWithoutLoginBehavior string This parameter controls the behavior of the Adding Connection* operation in case the current user is not logged in. This parameter may receive one of the following values:
  • tempUser (default value) - The addConnection operation will create a new temporary user, in case the current user is not logged in.
    When the addConnection operation finishes successfully, Gigya will fire the onConnectionAdded event.
  • alwaysLogin - This will cause the addConnection operation to behave like a call to login in case the current user is not logged in. When the addConnection operation finishes successfully, Gigya will fire the onLogin event.
  • loginExistingUser - This option is a hybrid of the previous two. In this option Gigya will search the current user's connecting identity in our DB. The addConnection operation will behave according to whether the user is identified as a returning user or a new user.
    If the user is identified as a returning user the addConnection operation will behave like a call to login and when the operation finishes successfully, Gigya will fire the onLogin event.
    If the user is not identified (i.e. a new user), the addConnection operation will create a new temporary user and when the operation finishes successfully, Gigya will fire the onConnectionAdded event.
Read more about this parameter in Add Connections without Logging-in.
* The adding connection operation may be initiated through the usage of the Add Connections Plugin or socialize.addConnection API method, and also through the usage of one of the following plugins: Comments Plugin, Chat Plugin, Activity Feed Plugin, Share Plugin.
  customEventMap JSON
object
Gigya defines a default "Event Map". This default map is used for Google Analytics integration and specifies which Gigya events will be tracked and how. Using this object you may override or add to the default tracking behaviour specified by Gigya. Learn about the structure and fields of this parameter in Overriding the Default Event Map
  dateFormat string The format of the date. The days, months, and years can be represented as follows: 
  • %d - a one-digit representation of the day of the month, 1-31
  • %dd -  a two-digit representation of the day of the month, 01-31
  • %M - a one-digit representation of the month, 1-12
  • %MM - a two-digit representation of the month, 01-12
  • %MMM -  the abbreviated name of the month, e.g. Jun, Jul
  • %MMMM - the full name of the month, e.g. July, August
  • %yy - a two-digit representation of the year, 01-99
  • %yyyy - a four-digit representation of the year, 2013

For example: dateFormat: "%d/%M/%yy" - > 29/5/12, or dateFormat: "%MMMM %d, %yyyy" - > May 29, 2012.

  defaultRegScreenSet string For use by Registration-as-a-Service customers. The ID of a previously defined registration screen-set for use in new user registration. Overrides the default registration screen-set defined in accounts.setPolicies.
Customers who want to implement their own registration screen should set this parameter to blank and bind a callback function to the OnError event wherever pending registration error 206001 appears.     
  disabledProviders string A comma-delimited list of provider names to exclude in the method execution. This parameter gives the possibility to specify providers to which that you don't want this method to apply. If you do not set this parameter, by default no provider is disabled (i.e. the method applies to all connected providers).
For example, if you would like the method to apply to all providers except Google+ and Twitter, define: disabledProviders: "googleplus, twitter".
Valid provider names include: facebook, twitter, yahoo, messenger, googleplus, linkedin, aol, foursquare, instagramrenren, qq, sina, kaixin, vkontakte, blogger, wordpress, typepad, paypal, amazon, livejournal, verisign, openid, netlog, signon, orangefrance, mixi, yahoojapan, odnoklassnikispiceworks, livedoor, skyrock, vznet, xing.
  enabledProviders string A comma-delimited list of provider names to include in the method execution. This parameter gives the possibility to apply this method only to a subset of providers of your choice. If you do not set this parameter, by default all the providers are enabled (i.e. the method applies to all connected providers).
For example, if you would like the method to apply only to Facebook and Twitter, define: enabledProviders: "facebook, twitter".
Valid provider names include:
"facebook, twitter, yahoo, linkedIn, messenger, googleplus, myspace, foursquare, vkontakte, renren, qq, sina, kaixin, aol, blogger, wordpress, typepad, livejournal, verisign, openid, skyrock, vznet".
In addition the following providers are supported and may be added explicitly: 
"netlog, signon, orangefrance, mixi, yahoojapan, spiceworks, livedoor, paypal, amazon".
You may use the '*' sign as an indication to include all the default providers. If you would like the API methods to apply to Netlog in addition to all the default providers, define: enabledProviders:"*,netlog".
  forceAuthentication Boolean The default value of this parameter is 'false'. If set to 'true', the user will be forced to provide her social network credentials during the login, even if she is already connected to the social network. This parameter is currently supported by Facebook, Twitter, Renren, and LinkedIn. Please note that the behavior of the various social networks may be slightly different: Facebook expects the current user to enter their password, and will not accept a different user name. Other networks prompt the user to re-authorize the application or allow a different user to log in. 
  facebookExtraPermissions

 

string A comma-delimited list of Facebook extended permissions to request from the user. This parameter gives the possibility to request extended permissions in addition to the permissions that Gigya has already requested.
Please refer to Facebook's extended permissions page, for the complete list of permissions.
For example, if you wish to RSVP to events on the user's behalf and to send text messages to the user, define: 
facebookExtraPermissions : "rsvp_event,sms"
Note: use the socialize.getRawData method to pull the extra data. 
  googleExtraPermissions string This parameter gives the possibility to request extended permissions in addition to the permissions that Gigya is already requesting. The supported values are: "wallet" - for Google wallet permissions.
  lang string Define the language of Gigya's user interface and error message. The supported languages and their codes can be found in our Language Support guide. For example:
lang: "zh-hk";
  newUsersPendingRegistration Boolean The default value of this parameter is 'true'. The default behavior - when a new user logs-in (registers) his new Gigya account is not considered final until socialize.notifyRegistration is called. While being not-final the identities associated with this account can be connected to another account without causing an error.
If this parameter is set to 'false' - when a new user logs-in (registers), his new Gigya account is final immediately.
  regSource string Origin of the registration. Can be any string value. regSource will typically hold the URL of the registration page, the default is the current URL. Can be used to set varying destination pages in accounts.setPolicies
Note: regSource is populated automatically only when the accounts.showscreenset API call is on the page, otherwise you must populate it yourself.
  sessionExpiration integer This parameter defines the time in seconds that Gigya should keep the login session valid for the user. To end the session when the browser closes, please assign the value '0'.
  • For Social Login, if this parameter is not specified, the session will be valid forever.
  • For RaaS, if this parameter is not specified, the value will be equal to '0' and the session will close together with the browser. For the session to be valid forever, the value should be set to "-2".
  shortURLs string

Using this parameter you may determine whether to use Gigya's URL shortening service for URLs passed in the status parameter. The optional values for this parameter are:

  • 'always' (default): always try to shorten URLs. Where providers permit, URLs are shortened to the fw.to domain. Customers using the European data center are shortened to the shr.gs domain.
  • 'whenRequired': URLs longer than 139 characters are shortened in accordance with provider preferences.
  • 'never' - never shorten URLs. Where providers permit, URLs are left untouched.

URL shortening requirements vary between providers and depend on the particular type of action and its content. URL shortening is only available for the providers LinkedIn, QQ, Twitter, mixi, and Hatena.
When Gigya's URL shortening service is active, Gigya tracks all the traffic coming from the distributed URLs. In such case, 'Referred Traffic' reportswill be available to you.

signIDs Boolean The default value is "false". If this field is set to "true", the User object returned by socialize.getUserInfo method and the Friend objects returned by socialize.getFriendsInfo or socialize.showFriendSelectorUI methods will be signed by Gigya. To learn more about this subject, please refer to the Security page of the Developer's Guide.
  trackAddressBarShares Boolean The default value of this parameter is 'false'. If set to 'true', the referred traffic that is identified as originally shared after a URL was copied by a user and sent out (via email or other means) will be tracked and used in the Referred Traffic and Referred Traffic by Provider reports.
Parameters used when initializing socialize:  
  autoLogin Boolean This parameter determines whether after a user logs in once to the site and visits again, he is automatically logged back into the site if he is logged into Facebook or Google+ at that time. If you set this value to 'true', make sure Native SDK Capabilties are enabled. The default value is 'false'.
  facebookInitParams JSON object An object with Facebook initialization parameters, which can override the original FB.init parameters. This includes channelUrl and other Facebook initialization parameters.

Backwards Compatibility

The Global Conf described above substitutes an older form of a conf object that we still support for backward compatibility. The advantage of the new form is that the variables are set before loading gigya.js, while in the old form they are set after.
In the old form the conf object was created once as a global var and passed as the first parameter of all API calls, setting global configuration parameters. Originally all our API methods were called with two parameters, conf and params. For example:

var conf=
{
  enabledProviders:  'yahoo,googleplus',
     connectWithoutLoginBehavior: 'alwaysLogin'
};...

gigya.socialize.getUserInfo(conf, params);


If you are already using the old form of the conf object, you may keep on using it, although we encourage you to move to the new form. Please note that some parameters, such as autoLogin, cannot be set via the old form of the conf object, since they must be set before loading gigya​.js.
Since we still support the conf object as a parameter in API calls, if you decide to pass the conf object to an API method, the variables set there will override any identical variables set in the global configuration object (the new form).
For example, if the new form global configuration object defines Facebook and Twitter as the enabled providers, and the conf object defines Yahoo and Google+ as the enabled providers, the enabled providers will be Yahoo and Google+:

<script type="text/javascript" src="http://cdn.gigya.com/js/gigya.js?apiKey=INSERT-YOUR-APIKEY-HERE">
{
   enabledProviders: 'facebook,twitter'
}
</script><script>
var conf=
{
    enabledProviders:  'yahoo,googleplus'
 };</script>

 

The params object, that used to be the second parameter, is now passed as the only parameter (i.e. gigya.socialize.getUserInfo(params); ). The params object enfolds all the specific parameters of the API method. In the JavaScript API Reference you may find per API method the list of parameters (params object members) that the method accepts - some are required and some are optional. The variables set in the params object will override any identical variables set either in the global configuration object or the conf object if defined. 

This object represents a site's basic Gigya configuration. This object is a JSON object that sets global Gigya variables before loading gigya.js. This allows the variables to be used when initializing socialize. The stored global configuration parameters that are set in this object are common to all the Gigya API calls on that page. If you define this object, it should be created once, using the following syntax:

<script type="text/javascript" src="http://cdn.gigya.com/js/gigya.js?apiKey=INSERT-YOUR-APIKEY-HERE">
{
  autoLogin: true,
  enabledProviders: 'facebook,twitter'
}
</script>

Note that autoLogin and enabledProviders are only examples of variables that can be set here.

 

 

<script type="text/javascript" src="http://cdn.gigya.com/js/gigya.js?apiKey=INSERT-YOUR-APIKEY-HERE">
{
  autoLogin: true,
  enabledProviders: 'facebook,twitter'
}
</script>

Note that autoLogin and enabledProviders are only examples of variables that can be set here.

Tags

This page has no custom tags.
This page has no classifications.

Comments

You must to post a comment.

Attachments