Was this article helpful?

Global Conf

Modified 12:05, 11 Apr 2013 by Tanya

Description

This object represents a site's basic Gigya configuration. This object is a JSON object that sets global Gigya variables before loading socialize.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/socialize.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 socialize.js script tag:

window.__gigyaConf = {enabledProviders:'facebook,twitter'};

 

 

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.
  enabledProviders string A comma-delimited list of provider names to include in the Gigya service. This parameter gives the possibility to apply this method to a subset of providers of your choice.
If you do not set this parameter, by default the following providers are enabled:
"facebook, twitter, yahoo, linkedIn, messenger, google, myspace, foursquare, vkontakte, renren, qq, sina, kaixin, orkut, aol, blogger, wordpress, hyves, typepad, livejournal, verisign, openid, skyrock, vznet".
In addition the following providers are supported and may be added explicitly: 
"googleplus, netlog, signon, orangefrance, mixi, yahoojapan, spiceworks, livedoor, paypal".
You may use the '*' sign as an indication to include all the default providers.
For example:
If you would like the API methods to apply to Netlog in addition to all the default providers, define: enabledProviders="*,netlog".
If you would like the API methods to apply only to Facebook, Twitter and Google+, define: enabledProviders="facebook,twitter,googleplus".
  disabledProviders string A comma-delimited list of provider names to disable in the Gigya service. This parameter gives the possibility to specify provides to which 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).Valid provider names include: facebook, twitter, yahoo, messenger, google, googleplus, linkedin, myspace, aol, foursquare, orkut, renren, qq, sina, kaixin, vkontakte, blogger, wordpress, typepad, paypal, livejournal, hyves, verisign, openid, netlog, signon, orangefrance, mixi, yahoojapan, spiceworks, livedoor, skyrock, vznet.
For example, if you would like the method to apply to all providers except Google and Twitter, define: disabledProviders="google,twitter".
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.
  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.
       
  cid string A string of maximum 100 characters length. This string is associated with each transaction and will later appear on 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. The "Context ID" combo box lets you filter the report data by site/application context.
  shortURLs string Using this parameter you may determine whether to use Gigya's URL shortening service for URLs, which you publish to social networks using Gigay's API. The optional values for this parameter are:
  • 'always' (default): always shorten URLs.
  • 'whenRequired': shorten URLs when needed - when posting to Twitter, LinkedIn, MySpace and Yahoo where the status update is limited to 140 char.
  • 'never' - never shorten URLs.
When Gigya's URL shortening service is active, Gigya tracks all the traffic coming from the distributed URLs. In such case, 'Referred Traffic' reports will be available to you.
  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.
  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'. If this parameter is not specified, the session will be valid forever.
  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 login, even if she is already connected to the social network. Please note, that the behavior of the various social networks may be slightly different. Facebook expects the current user to enter her password, and would not accept a different user name. Other networks prompt the user to re-authorize the application or allow a different user to log-in.
  lang string Define the language of Gigya's user interface and error message. The supported languages are:
Language Language Code
English "en" (default)
Arabic "ar"
Chinese "zh-cn"
Chinese (Hong Kong) "zh-hk"
Chinese (Taiwan) "zh-tw'
Czech "cs"
Danish "da"
Dutch "nl"
Finnish "fi"
French "fr"
German "de"
Greek "el"
Hebrew "he"
Hungarian "hu"
Indonesian "id"
Italian "it"
Japanese "ja"
Korean "ko"
Malay "ms"
Norwegian "no"
Polish "pl"
Portuguese "pt"
Portuguese (Brazil) "pt-br"
Romanian "ro"
Russian "ru"
Spanish "es"
Spanish (Lat-Am) "es-mx"
Swedish "sv"
Tagalog (Philippines) "tl"
Thai "th"
Turkish "tr"
Ukrainian "uk"
Vietnamese "vi"

For example:
lang: "zh-hk";
  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.
  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
  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.
  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.

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 at that time. If you set this value to 'true', make sure Auto Session Renewal is 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 socialize.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,google',
     connectWithoutLoginBehavior: 'alwaysLogin'
};
...

gigya.services.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 socialize.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/socialize.js?apiKey=INSERT-YOUR-APIKEY-HERE">
{
   enabledProviders: 'facebook,twitter'
}
</script>

<script>
var conf=
{
    enabledProviders:  'yahoo,google'
 };
</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 socialize.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/socialize.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/socialize.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 set.

Comments

You must to post a comment.

Attachments