Was this article helpful?

socialize.showShareBarUI

Last modified 07:53, 22 Jul 2014

Description

Displays the Share Bar plugin, which is comprised of one or more share buttons arranged in a horizontal or vertical bar. The buttons can be direct bookmark buttons, a general share button, or an email button. Certain bookmark buttons and the general share button can display a counter representing the number of shares. For more information regarding the counters, refer to the socialize.getProviderShareCounts API method.
Once a user clicks on a direct bookmark button, the window of the provider will be opened for direct bookmarking. Once a user clicks on the general share button, the Simple Share mode of the Share plugin will popup, enabling your user to share and bookmark content and site activities to a selected social destinations.

Notes:
  • If you plan on integrating the Share Bar plugin, we highly recommend reading the Share Bar plugin in the Developer's Guide, which is a step-by-step guide for integrating the Share Bar plugin and also provides a reference and guide for the various customization options.
  • Full control over content shared to Facebook requires implementation of Open Graph meta tags in your website. Meta tags are supported by all major social networks. Meta tags can be tested and configured using the Facebook debugger and Google's webmaster tools. For more information see Sharing Content.  

 

ShareBarUI.gif

 

Syntax

gigya.socialize.showShareBarUI(params)

 

Method Parameters

The following table lists the params object members:

Required Name Type Description
Required shareButtons array or string An array of ShareButton objects or a comma-separated list of providers, representing the buttons to display in the share bar. When passing a comma-separated list, the plugin behaves as if an array of ShareButton objects was passed, where the only value in each object is the provider name.
Valid provider names include: Facebook, Twitter, LinkedIn, Messenger, Delicious, Reddit, Googleplus*, Google Bookmarks, VKontakte, Spiceworks, Viadeo, nk.pl, Xing, Tuenti, Pinterest*, MyAOL, Kindle, Baidu, FriendFeed, Tumblr, Stumbleupon, Orkut, Skyrock, QQ, Sina, mixi**, Kaixin, VZnet.
In addition to provider names, the provider list may include these reserved names which implement the provider's own (native) button:
  • 'facebook-like' - represents the Facebook Like button.
  • 'facebook-send' - represents the Facebook Send button.
  • 'facebook-subscribe' - represents the Facebook Subscribe button. Note: This button can only be configured as full ShareButton object, not by a simple string.
  • 'twitter-tweet' - represents the Twitter Tweet button.
  • 'twitter-hashtag' - represents the Twitter Hashtag button. Specifies a hashtag within the text and the button.
  • 'twitter-mention' - represents the Twitter Tweet to button. Allows you to specify a user to mention from within the text and the button.
  • 'google-plusone' - represents the Google +1 button.
  • 'googleplus-share' - represents the Google + Share button.
  • 'googleplus-interactive' - represents the Google + Interactive Post button.
  • 'moshare-sms' - represents the moShare button for mobile sharing via text message.
  • 'foursquare' - represents the foursquare button.
  • 'foursquare-save' - represents the Save to foursquare button.
  • 'share' - represents a button in the share bar that triggers the Simple Share dialog.
  • 'email' - represents a button in the share bar that triggers the standard share dialog in email mode.
  • 'comments' - represents a Comments button. The button is displayed with a counter when the ShareButton object of the comments button contains the fields: categoryID and streamID, and the number of comments is larger than 0.
  • 'print' - represents a​ button in the share bar that triggers the print operation.
  • 'pinterest-pinit' - represents the Pinterest pin-it button .
  • 'tvtag' - represents the TVTag button (formerly the GetGlue button).

* The Googleplus button is unable to display share counts because Google do not have an API that returns share counts.
 

  containerID string An ID of a <DIV> element on the page in which you want to display the plugin.
  userAction UserAction object The user action to share. The UserAction object enfolds newsfeed data, including text, media, link, etc.
Optional actionAttributes JSON object In Gamification your users receive points for actions they perform on your site, in this case clicking a share button grants the user points. Action Attributes may be used to annotate actions with additional information, such as the section of the web site that generated the action. If you set here the actionAttributes, each time a user clicks a share button, the action also receives an attribute, for example "tv-show":"glee", which can mean that the action was performed on the "Glee" page of the site. 
actionAttributes contain a JSON object comprised of a series of attribute keys (categories) with associated values. You can also use a generic "tags" key. No more than three values can be given, they can be with a single key or each have their own key. For more information see Variants and Action Attributes. Action attributes are later used to filter GM Plugins by a certain attribute.
Example:  {"<attribute key1>": ["<attribute value1>", "<attribute value2>"],  "<attribute key2>": "<attribute value3>" }
  buttonImages JSON object Using this object you may override the default design of a share button. Specify your alternative button images using the object fields. The following fields are supported:
buttonLeftImgUp, buttonLeftImgOver, buttonCenterBGImgUp, buttonCenterBGImgOver, buttonRightImgUp, buttonRightImgOver, countBGImg.
Read more in the Applying a New Button Design guide.
Note: The images are specified separately from the buttonTemplate in order to be pre-loaded. If pre-loading is not required the images may also be specified directly in the buttonTemplate.
  buttonTemplate string
(HTML)
Using this parameter you may override the default design of a single button. Defines an HTML template representing the design of a single button. The HTML template supports the following placeholders: $iconImg, $text, $onClick.
  buttonWithCountTemplate string (HTML) Using this parameter you may override the default design of a single button with counter. Defines an HTML template representing the design of a single button with counter. The HTML template supports the following placeholders: $iconImg, $text, $onClick, $count.
  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.
Note: the value of this parameter overrides the value of the identical parameter in the global configuration object.
  context object A reference to a developer created object that will be passed back unchanged to the event handlers as one of the fields of the eventObj (see extended explanation in the "Plugin Events" section below).
  countURL URL Allows to specify a canonical URL and counts are then retrieved from this URL. The countURL ensures that the counts are incremented properly, and tracks counts against the canonical URL. Does not work with providers' native buttons (see the shareButtons parameter for native button details). 
  deviceType string Determines the type of the device on which the Share Bar UI is displayed. The parameter supports the following values:
  • desktop (default) - render the share bar in regular mode
  • mobile - render the share bar in mobile view mode 
  • auto - identify the device (user-agent) and if it is a mobile device, render in the mobile view mode

Note: When the Share Bar is set to deviceType mobile or auto (on mobile), clicking the email share will open the mail client rather than the Gigya share bar UI.

  displayCountThreshold integer The threshold of the counter to be displayed, i.e. each button in the share bar will display its counter only once it reaches this number. If the counter has not reached this threshold, the counter will not be displayed for the provider. The default value is 0. Note: This parameter does not apply to the Facebook Like/Send and Twitter buttons.
  disabledProviders string A comma delimited list of providers that should not be displayed on this plugin in Multiple Selection Share mode. Valid provider names include: 'facebook', 'twitter', 'messenger', 'linkedin', 'orkut'.
For example, if you would like this plugin to show all providers icons but LinkedIn and Twitter, define: disabledProviders: "linkedin,twitter".
Note: the value of this parameter overrides the value of the identical parameter in the global configuration object.
   enabledProviders string  A comma delimited list of providers that should be displayed on this plugin in Multiple Selection Share mode. Valid provider names include: 'facebook', 'twitter', 'messenger', 'linkedin', 'orkut'.
For example, if you would like this plugin to show only the icons of Facebook and Twitter, define: enabledProviders: "facebook,twitter".
Note: the Share plugin may show up to six social network buttons on its main screen (more social destinations may be shown in the "More" screen).
Note: the value of this parameter overrides the value of the identical parameter in the global configuration object.
  grayedOutScreenOpacity integer
(0-100)
This parameter allows you to gray-out the screen behind the plugin to emphasize the "modal" environment in Multiple Selection Share mode. Graying-out covers the entire page behind the plugin with a gray transparent layer. Using this parameter you can define the opacity of the gray layer. The value of this parameter should be a number between 0-100, where:
  • 0 - clear (not grayed out). This is the default, if this parameter is not set.
  • 100 - opaque (blacked out).
  • 20 - is our recommended value for gray-out opacity.
  iconsOnly Boolean This parameter determines whether the share bar buttons are displayed as icons only, without text and borders. The default value of this parameter is 'false'.
  initialView string Determines the initial view of the plugin when it loads in Multiple Selection Share mode. There are three options:
  • 'share' (default) - shows the default share view.
  • 'more' - shows the "More" view. This option is only relevant if the showMoreButton parameter (see below) is set to 'true'. To learn more, please read the Adding More Destinations page.
  • 'email' - shows the "Email" view. This option is only relevant if the showEmailButton parameter (see below) is set to 'true'. To learn more, please read the Sharing via Email page.
  <provider-name>Key string Using this parameter, you can specify all the API keys of the social networks that require an API key, e.g. 'mixiKey'.
  layout string Sets the arrangement of buttons in the bar. May be:
  • 'horizontal' (default)
  • 'vertical'

 
noButtonBorders Boolean This parameter determines whether the share bar buttons are displayed without borders. The default value of this parameter is 'false' (the buttons are displayed with borders).
  operationMode string Using this parameter determines which Share Plugin mode is displayed; either the Multiple Selection Share mode or the Simple Share mode. Please refer to the Simple Share section for an extended explanation. The optional values for this parameter are:
  • 'multiSelect' - Opens the Share Plugin with multi-select options, enabling the user to share on multiple social networks.
  • 'simpleShare' - Opens the Share Plugin in the Simple Share mode. This is the default display. 
  • 'autoDetect' - Automatically opens the Share Plugin according to the user's connection status; if the user is connected the Multi-select mode is displayed, and if the user is not connected the Simple Share mode is displayed.
  shareCountCacheTimeout integer This parameter defines how long the share counts data will be stored in local cache. The default value of this parameter is 300,000 milliseconds. The share counts data will not be refreshed within this interval, for better performance.
  shareTimeout integer Sets a timeout to the sharing operation in Multiple Selection Share mode. Set this parameter with the maximum number of seconds to wait for the sharing operation to be completed. If a timeout occurs, the Share plugin will close and an onError event will be fired with errorCode=504001 and errorMessage="Share request timeout".
  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, Orkut, QQ and Twitter.
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.


Note: the value of this parameter overrides the value of the identical parameter in the global configuration object.
  showCounts string This parameter determines if and where to display the share counts in relation to the share button. The options are:
  • 'right' (default)
  • 'top'
  • 'none'
The following providers support counters: 'facebook', 'twitter', 'delicious', 'stumbleupon', 'linkedin', 'facebook-like', 'facebook-send', 'twitter-tweet', 'google-plusone', 'moshare-sms', 'share', 'comments', 'pinterest', 'pinterest-pinit'. Note: for provider='moshare-sms' the counters can be either right or none, if top is defined, the moshare will not display counters. 
   showTooltips Boolean This parameter's default value is 'false'. If set to 'true', a tooltip will be displayed when the mouse hovers over a social network icon. The tooltip presents the social network's full name. This parameter is relevant only in Multiple Selection Share mode.
  simpleShareConfig JSON object In Simple Share mode, when the user selects a social network for sharing, this parameter enables you to add an option to display a dialog offering to connect the user to your site through the selected social network. The simpleShareConfig parameter accepts a JSON object with the following optional members:
  • postShareAction - accepts two values: "close" (default) and "connect". When "connect" is used, then after the user clicks on a button of a social network that supports authentication, a dialog is displayed, offering to connect the user to your site with the selected social network.
  • postShareConnectCaptionText - The text that is displayed as the header of the connect dialog. The default text is "Thanks for sharing!".
  • postShareConnectBodyText - The text that is displayed in the body of the connect dialog. The default text is "To make sharing even simpler".
This parameter is relevant only when using the Simple Share mode (only if the operationMode parameter (see above) is set to 'simpleShare' or 'autoDetect').
Read more about this feature in the Post Share Connection section.
  tags string A comma separated list of tags that are used to identify the share operation.
  <provider-name>UserAction UserAction object It is possible to specify different content to publish for each social network in Multiple Selection Share mode. For this purpose, the method supports a set of parameters with the same name format: <provider-name> (i.e. facebook, twitter, googleplus, etc.) followed by "UserAction". For example: twitterUserAction - specifies the content to be used specifically when publishing to Twitter.
Each of these optional parameters accepts a UserAction object and if specified override the userAction parameter when posting to that provider. In other words, the userAction parameter (see above) specifies the default content to be used for all social networks and <provider-name>UserAction specifies the content to be used for the specific network.
  userMessagePlaceholder string Text that appears as a placeholder for the user message in the shareUI when in multiselect mode. When the user clicks the user message input box in the shareUI, the text disappears.
  wrap Boolean Indicates whether to "wrap" the buttons in the Share Bar plugin. The default is 'false', and when set to 'true' the share bar's buttons will be automatically wrapped to the next line if the current line isn't wide enough to display all the buttons.  
Email Button related Parameters:  
  showEmailButton Boolean Gigya offers an option of sharing the user action via email. Sharing via email is provided through the "Email" button on the Share Bar, or by enabling of an "Email" button on the Share Plugin when in Multiple Selection Share mode. To enable the "Email" button, set this parameter to 'true' (The default value is 'false'). To learn more about this feature, please read the Sharing via Email page in the Developer's Guide.
  useEmailCaptcha Boolean Indicates whether to use a CAPTCHA mechanism when sending emails. When CAPTCHA is used, emails that are sent through Gigya share arrive at their destination and not a spam folder. The default value is 'false'. When set to 'true', a captcha is presented before sending the email.
  emailBody string (HTML) This parameter is only relevant if the showEmailButton parameter (see above) is set to 'true'. Using the "Email" screen of the Share Plugin, users may send emails to selected email contacts. Gigya defines a default email body structure which is based on the User Action fields, and the message entered by the user in the Share Plugin. You may define an alternative email body, using the emailBody parameter. The email body should be defined in HTML format, and may include the following replacement strings: $sender$, $URL$ and $userMsg$.
To learn more about this feature, please read the Sharing via Email page in the Developer's Guide.
  dontSendEmail Boolean This parameter is only relevant if the showEmailButton parameter (see above) is set to 'true'. Setting this parameter to 'true' instructs Gigya to not actually send an email when the user chooses to send one. You can use this parameter along with the onSendDone event data to send the actual email from your own servers. The default value is 'false' (Gigya server will send the email).
To learn more about this feature, please read the Sharing via Email page in the Developer's Guide.
  emailProviders string A comma delimited list of email providers that should be displayed on the email screen for importing contacts. Valid provider names include: 'yahoo', 'googleplus'.
Auto Share related Parameters:
The following parameters are relevant only if you are in Multiple Selection Share mode. To learn more about this feature, please read the Automatic Sharing guide.
 
  showAlwaysShare string This parameter determines whether to show an "Always share" checkbox at the bottom of the Share Plugin. If the user checks this checkbox and presses "Publish", Gigya will turn on an automatic share for this user. Each time this user repeats the same type of action, Gigya will automatically share the action without prompting the user with the Share Plugin. The type of action is determined using the autoShareActionID parameter (see below). The action will be shared on the Social Networks which the user selected when he checked the "Always share" checkbox. If a Network is no longer connected, the share will fail without notifying the user.
The optional values for this parameter are:
  • 'hide' (default) - do not display the "Always share" checkbox.
  • 'checked' - the "Always share" checkbox is displayed and checked by default.
  • 'unchecked' - the "Always share" checkbox is displayed and unchecked by default.
Note: to apply this feature, you must set both showAlwaysShare and the autoShareActionID parameters.
  autoShareActionID string Use this parameter to specify a unique identifier for the type of action that the user has performed on your site. For example: "Commented", "Rated", "Replied", "Liked", etc.
The user selection (Always Share) will apply only to this ID.
  autoShareExpiration string Using this parameter, you may assign an expiration date/time for the user selection for the specific autoShareActionID. The default is never expire. The expected format is the Unix time format (i.e. the number of milliseconds since Jan. 1st 1970).
  autoShareActionDisplay string Using this parameter, you may change the default text shown next to the "Always share" checkbox and the "Never share" link. The autoShareActionDisplay string will be appended to the "Always share" and "Never share" strings, i.e. "Always share XXX" and "Never share XXX" where XXX is the autoShareActionDisplay string. The default value of autoShareActionDisplay is the string "this".
'Share' button related Parameters:  
The following parameters are relevant only if you are in Multiple Selection Share mode and using the Simple Share dialog (enabled by creating a generic "Share" button).  By default the Share button opens a provider selection box, in which the last option is a "More" button which opens a second box showing all available providers. Gigya offers tens of additional destinations for social sharing. To learn more about this feature, please read the More Networks Screen page in the Developer's Guide.
  showMoreButton Boolean Show the "More" button in the Share button's provider selection box. Use this parameter to show/hide the "More" button. The default value is 'true' (button is shown).
Note that the "More" button is only displayed when there is insufficient space to show all the available providers in the initial provider selection box. When set to 'false', providers which do not fit into the initial selection box are not displayed.
  moreEnabledProviders, moreDisabledProviders string Use these parameters to define which providers are displayed in the Share button's provider selection box, and also to determine the order.  Each parameter is set with a comma separated string of destination names. This pair of parameters have similar logic to the enabledProviders and disabledProviders parameters (see above). Valid providers include:
delicious, digg, friendfeed, googlebookmarks, messenger, myaol, stumbleupon, orkut, skyrock, qq, sina, kaixin, renren, vznet, vkontakte, spiceworks, viadeo, nkpl, xing, tuenti, technorati, plaxo, reddit, formspring, tumblr, faves, newsvine, fark, mixx, bit.ly, hatena, misterwong, ask, amazon, gmail, baidu, box.net, netlog, evernote, aolmail, currenttv, yardbarker, blinklist, diigo, dropjack, segnalo, linkagogo, kaboodle, skimbit, facebook, twitter, googleplus, linkedin, pinterest, mixi, odnoklassniki, douban.

To learn more about this feature, please read the Adding More Destinations page in the Developer's Guide.
Note: In addition to the above automatic destinations, Gigya supports 150 more destinations. These destinations should be explicitly requested. Please contact us by filling in a support form on our site. You can also access the support page by clicking "Support" on the upper menu of Gigya's site. Check out the list of additional destinations here
Events Registration Parameters:  
  onSendDone function ref A reference to an event handler function that will be called when the process of sharing to the selected social network has finished. This does not include submitting comments; for comments use onShareButtonClicked
Note that in some instances share actions fire OnSendDone before they have completed: for bookmark providers and emails onSendDone will fire immediately, and for other providers it will fire after the share is complete.
  onShareButtonClicked function ref A reference to an event handler function that will be called when one of the plugin's buttons is clicked. To register a click on a third-party (external) button, use onSendDone.
  onLoad function ref A reference to an event handler function that will be called when the plugin has finished drawing itself.
  onError function ref A reference to an event handler function that will be called when an error occurs.
Deprecated:  
  facebookLikeButton JSON object Deprecated. Please use the shareButtons parameter instead, along with the 'facebook-like' value.
This parameter adds the Facebook Like button to the share bar.

 

ShareButton Object

A JSON-encoded object representing a single button in the share bar:

Required Field Name Type Description
Required provider string The label to display on the button and the provider name. For a list of valid providers see the ShareButtons array description above.
Optional *Optional parameters iconImgUp, iconImgOver, iconOnly and tooltip will not work with reserved name ("native") share buttons: 'facebook-like', 'facebook-send', 'facebook-subscribe', 'twitter-tweet', 'twitter-hashtag', 'twitter-mention', 'kindle', 'comments', 'google-plusinteractive', 'google-plusone', 'googleplus-share', 'moshare-sms', 'foursquare-save', 'tvtag'. The availability of other options depends on the type of service provided by the specific provider.
  enableCount Boolean If 'true', displays the counter. Can be overriden per provider. The default value is 'true'.
  countURL URL Allows to specify a canonical URL and counts are then retrieved from this URL. The countURL ensures that the counts are incremented properly, and tracks counts against the canonical URL.​
  iconImgOver* string Path to an image file to display on the share button, on mouse over.
  iconImgUp* string Path to an image file to display on the share button. 
  iconOnly* Boolean If 'true', displays the icon only, not the text and borders of the button.
  tooltip* string Tooltip to show when mouse over.
  url string If defined, this parameter overrides the share button's value of the URL to be shared. Read more about the how the Share Button's URL is determined.
  userAction UserAction object If defined, this parameter overrides the user action to share. The UserAction object enfolds newsfeed data, including text, media, link, etc.
  userMessage string If defined, this parameter overrides the userMessage field of the default userAction method param for this share button.
  These following fields are relevant only if provider='facebook-like':
  action string Defines the verb to display on the button, maps to the Facebook 'action' parameter. Accepts two values: "like" (default) or "recommend".
  colorscheme string Defines the color-schemes of the button background. Accepts two values: "light" (default) or "dark".
  font  string Defines the font of the text on the button. Accepts the following values: "tahoma", "verdana", "arial", "lucida grande", "segoe ui", "trebuchet ms".
  width integer Defines the width of the button. 
  These following fields are relevant only if provider='facebook-send':
  colorscheme string Defines the color-schemes of the button background. Accepts two values: "light" (default) or "dark".
  font  string Defines the font of the text on the button. Accepts the following values: "tahoma", "verdana", "arial", "lucida grande", "segoe ui", "trebuchet ms".
  These following fields are relevant only if provider='facebook-subscribe':
  colorscheme string Defines the color-schemes of the button background. Accepts two values: "light" (default) or "dark".
  font  string Defines the font of the text on the button. Accepts the following values: "tahoma", "verdana", "arial", "lucida grande", "segoe ui", "trebuchet ms".
  These following fields are relevant only if provider='twitter-tweet':
  via string The screen name of the user to whom to attribute the Tweet.
  defaultText string If defined, this parameter overrides the default text to include in the Tweet when sharing from the site. The default text to be overwritten is the page title.
  lang string The language for the Tweet button.
  related string Related accounts to suggest to the user. Using this field you can suggest accounts for a user to follow once they have sent a Tweet using your Tweet Button.
  These following fields are relevant only if provider='twitter-hashtag':
  hashtag string The hashtag to associate with this button. 
  defaultText string If defined, this parameter overrides the default text to include in the Tweet when sharing from the site.
  lang string The language for the Tweet button.
  related string Related accounts to suggest to the user. Using this field you can suggest accounts for a user to follow once they have sent a Tweet using your Tweet Button.
  These following fields are relevant only if provider='twitter-mention':
  mention string The user to mention in this Tweet, e.g. @gigya.
  defaultText string If defined, this parameter overrides the default text to include in the Tweet when sharing from the site.
  lang string The language for the Tweet button.
  related string Related accounts to suggest to the user. Using this field you can suggest accounts for a user to follow once they have sent a Tweet using your Tweet Button.
  These following fields are relevant only if provider='kindle':
  title string A CSS selector that refers to the title of the article.
  author string A CSS selector that refers to the author of the article.
  published string A CSS selector that refers to the published date of the article, format: yyyy-mm-dd.
  content string A CSS selector that refers to the content of the article.
  exclude string A CSS selector that refers to the containers that needs to be excluded from the content area.
  asin string A link to Amazon Standard ID Number.
    Notes:
  1. In addition to using Custom CSS Selectors, you can mark the title, author, and publication date on your pages using Open Graph, schema.org, hNews, or Blogger/Blogspot, and the main body of content on your pages using schema.org, hNews, or Blogger/Blogspot. For more information, read Amazon's Kindle button documentation, or the Share Bar plugin's Guide.
  2. Page markup is mandatory, the Send to Kindle button will trigger an error if the appropriate markup/CSS Selectors are not in place.
  These following fields are relevant only if provider='comments':
  categoryID string The identifier of the Comments category for which the comments button is displayed. This field, with the streamID field, must be set in the ShareButton object of the comments button for the counter to be displayed. 
  streamID string The identifier of the Comments stream for which the comments button is displayed. his field, with the categoryID field, must be set in the ShareButton object of the comments button for the counter to be displayed.
  These following fields are relevant only if provider='googleplus-interactive':
  callToActionLabel string The name given to the "call to action", e.g. "Listen". This field is a verb that accurately describe the action that will be taken by the user. You can choose a label from here. This field is optional, and the default value is "Open".
  callToActionURL string The URL to which that the user will be taken when the "call to action" button is clicked from a web browser, e.g. 'http://plus.google.com/pages/create'. This field is required.
  callToActionDeepLinkID string The URI path as a deep link ID for the "call to action button", e.g. '/pages/create'. The value must be 512 characters or fewer in length. This field is optional.
  clientID string The OAuth 2.0 client ID that was obtained from the Google APIs Console, e.g. 'xxxx.apps.googleusercontent.com'. This field is required.
  contentURL string The content URL that points to the page that you want to render in the preview snippet in the share post, e.g. 'https://plus.google.com/pages/'. This field is required.
  contentDeepLinkID string The URI path as a deep link ID for the content link in the shared post, e.g. '/pages'. The value must be 512 characters or fewer in length.This field is optional.
  cookiePolicy string Directs the interactive share button to store user and session information in a session cookie. There are three available values: "uri", "single_host_origin", and "none". Read more to determine a value for the cookie policy. This field is required.
  preFillText string The text that is prefilled in the comment area of the share box on behalf of the user, e.g. 'Create your Google+ Page too!'. The user can edit or remove the prefilled text. This field is optional.
    Note: For more information about each field please refer to https://developers.google.com/+/web/share/interactive.
  These following fields are relevant only if provider='google-plusone':
  size string The size of the Google +1 button. Accepts the following values: "small", "medium" (default if not set), "standard", "tall".  See the notes below googleplus-share.
  These following fields are relevant only if provider='googleplus-share':
  width integer Defines the width of the button.
  height integer Defines the height of the button.
  annotation string The annotation to display next to the button. This parameter overrides the showCounts parameter. Accepts the following values:
  • inline - Displays profile pictures of connected users who have shared the page and a count of users who have shared the page.
  • bubble (default)Displays the number of users who have shared the page in a graphic next to the button.
  • vertical-bubble - Displays the number of users who have shared the page in a graphic above the button.
  • none - Do not render any additional annotations.
   

Notes:

  1. To see how Google buttons are rendered, go to https://developers.google.com/+/web/share/ .
  2. Google's buttons policy is available at https://developers.google.com/+/web/buttons-policy .
  These following fields are relevant only if provider='moshare-sms':
  iconsOnly Boolean This parameter determines whether the moShare button is displayed as icon only, without text and borders. The default value of this parameter is 'false'.
  These following fields are relevant only if provider='foursquare-save':
  vid string A foursquare venue ID.
  variant string The button size to render. Can be either undefined or "wide".
  hideTooltip Boolean The default value is "false". When set to "true" shows description tooltip on hover.
  These following fields are relevant only if provider='tvtag' (formerly GetGlue):
  url string A tvtag url, e.g. http://tvtag.com/tv_shows/big_bang_theory. The tvtag url must be a valid tvtag url or a tvtag useraction pointing to a valid tvtag url.
  title string The title of the object being shared.
  message string A custom message.

 

Plugin Events

An Event Handler is a JavaScript function with the following signature:

functionName(eventObj)

The single argument, eventObj, contains information about the event and has different fields for different events.

The following tables specify the list of fields available in the eventObj for each event:

 

onLoad Event Data

Field Type Description
eventName string The name of the event.
sourcestringThe source plugin that generated this event. The value of this field is the name of the plugin's API method, e.g. 'showLoginUI', 'showCommentsUI', etc.
context object The context object passed by the application as parameter to the API method, or null if no context object has been passed.

 

onError Event Data

Field Type Description
eventName string The name of the event.
sourcestringThe source plugin that generated this event. The value of this field is the name of the plugin's API method, e.g. 'showLoginUI', 'showCommentsUI', etc.
context object The context object passed by the application as parameter to the API method, or null if no context object has been passed.
errorCode integer The result code of the operation. Code '0' indicates success, any other number indicates failure. For a complete list of error codes, see the Error Codes table.
errorMessage string A short textual description of an error, associated with the errorCode, for logging purposes.
errorDetails string This field will contain the exception info, if available.
 

onSendDone Event Data

Field Type Description
eventName string The name of the event.
sourcestringThe source plugin that generated this event. The value of this field is the name of the plugin's API method, e.g. 'showLoginUI', 'showCommentsUI', etc.
context object The context object passed by the application as parameter to the API method, or null if no context object has been passed.
providers string The name of the sharing target (i.e. 'twitter', 'email', etc.). Note: Pinterest does not fire this event.
userMessage string The textual message that the user entered in the editable text box of the Share Plugin.
targetURL string The URL that was shared.

  

onSendDone Event Data - Email

When a user chooses to share via email, he will use the plugin's email screen and press the 'Send' button. In this situation Gigya fires an onSendDone event with the providers field set to 'email' and with extra email related fields.

Field Type Description
eventName string The name of the event.
sourcestringThe source plugin that generated this event. The value of this field is the name of the plugin's API method, e.g. 'showLoginUI', 'showCommentsUI', etc.
context object The context object passed by the application as parameter to the API method, or null if no context object has been passed.
providers string 'email'.
userMessage string The user custom message.
recipients array An array of objects that each has a name property and an email property corresponding to the recipients of the email that has been sent.
sender string The name or email of the sender.

To learn more about using this event, please read the Sharing via Email page in the Developer's Guide.

onShareButtonClicked Event Data

Field Type Description
eventName string The name of the event.
sourcestringThe source plugin that generated this event. The value of this field is the name of the plugin's API method, e.g. 'showLoginUI', 'showCommentsUI', etc.
context object The context object passed by the application as parameter to the API method, or null if no context object has been passed.
shareItem ShareButton object The object representing the share button that has been clicked. Note: Pinterest does not fire this event.

 

Global Event Triggered

By using this Plugin, the following global event may be triggered: onConnectionAdded.

To register an event handler use the socialize.addEventHandlers API method. Refer to the onConnectionAdded event data. Refer to the Events page in the Developer Guide - to learn more about how to handle events generated by the Gigya service.

 

Code Sample

var ua = new gigya.socialize.UserAction(); 
ua.setLinkBack("http://www.youtube.com/watch?v=jqxENMKaeCU"); 
ua.setTitle("Adobe Gets Into Widget Distribution And Advertising With Help From Gigya");

var params ={ 
    userAction:ua,
    shareButtons: "facebook-like,google-plusone,share,twitter-tweet,email",
    containerID: 'divButtons' // The ID of the <DIV> element on the page in which the plugin is displayed
}

// Show the share bar
gigya.socialize.showShareBarUI(params);

Notes:
  • This sample is not meant to be fully functional code. For brevity's sake, only the code required for demonstrating the API call itself is presented.
  • To run the code on your own domain, add your Gigya API key to the socialize.js URL. A Gigya API key can be obtained on the Site Dashboard page on Gigya's website. Please make sure that the domain from which you are loading the page is the same domain name that you used for generating the API key.

 

In the ShareBar Plugin demo you will find a complete working example, which uses the socialize.showShareBarUI method. You may view the code, run it and view the outcome.

Tags

This page has no custom tags set.

Comments

You must to post a comment.

Attachments