Gigya Job Openings

Share Button Object

Skip to end of metadata
Go to start of metadata

shareButton Object

A JSON-encoded object representing a single, unique button within the share bar:

RequiredField NameTypeDescription
providerstringThe label to display on the button and the provider name. For a list of valid providers see the ShareButtons array description above.
enableCountBooleanIf 'true', displays the counter. Can be overridden per provider. The default value is 'true'.
countURLURLAllows you to specify a canonical URL and counts are then retrieved from this URL. ThecountURL ensures that the counts are incremented properly, and tracks counts against the canonical URL.
iconImgOver*stringPath to an image file to display on the share button, on mouse over.
iconImgUp*stringPath to an image file to display on the share button. 
iconOnly*BooleanIf 'true', displays the icon only, not the text and borders of the button.
popupHeightstring/integerDefines the height of the popup window rendered when clicking on the provider's button. If passed as an integer it will define as pixels. If this parameter is passed as a string it can be either in pixels or percent, e.g., "200px" or "40%".
popupPositionXstring/integerDefines the position of the left-top corner of the popup window rendered when clicking on the provider's button from left to right. If passed as an integer it will define as pixels. If this parameter is passed as a string it can be either in pixels or percent, e.g., "200px" or "40%".
popupPositionYstring/integerDefines the position of the top of the popup window rendered when clicking on the provider's button from the top of the screen. If passed as an integer it will define as pixels. If this parameter is passed as a string it can be either in pixels or percent, e.g., "200px" or "40%".
popupWidthstring/integerDefines the weight of the popup window rendered when clicking on the provider's button. If passed as an integer it will define as pixels. If this parameter is passed as a string it can be either in pixels or percent, e.g., "200px" or "40%".
tooltip*stringTooltip to show when the button is hovered over.
   *Optional parameters iconImgUp, iconImgOver, iconOnly and tooltip will not work with reserved name ("native") share buttons: 'facebook-like', 'facebook-share', '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, see below for options available on native buttons.
Note: Custom icon images can only be applied to generic and non-native buttons. Styling parameters applied to Social network native buttons take no effect. A list of available native buttons can be found in the description of the 'shareButtons' parameter above. 
urlstringIf 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.
userActionUserAction objectIf defined, this parameter overrides the user action to share. The UserAction object enfolds newsfeed data, including text, media, link, etc.
userMessagestringIf 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':
actionstringDefines the verb to display on the button, maps to the Facebook 'action' parameter. Accepts two values: "like" (default) or "recommend".
colorschemestringDefines the color-schemes of the button background. Accepts two values: "light" (default) or "dark".
font stringDefines the font of the text on the button. Accepts the following values: "tahoma", "verdana", "arial", "lucida grande", "segoe ui", "trebuchet ms".
widthintegerDefines the width of the button. 
layoutstringDefines the Facebook button layout parameter. The supported values are:"standard", "box_count", "button_count", "button". 
 These following fields are relevant only if provider='facebook-send', ' facebook-subscribe' or 'faceboook-share':
colorschemestringDefines the color-schemes of the button background. Accepts two values: "light" (default) or"dark".
font stringDefines 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':
viastringThe screen name of the user to whom to attribute the Tweet.
defaultTextstringIf 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.
langstringThe language for the Tweet button.
relatedstringRelated 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.
widthstringNumber (in pixels). Defines the width of the button. e.g., width='50'
 These following fields are relevant only if provider='twitter-hashtag':
hashtagstringThe hashtag to associate with this button. 
defaultTextstringIf defined, this parameter overrides the default text to include in the Tweet when sharing from the site.
langstringThe language for the Tweet button.
relatedstringRelated 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':
mentionstringThe user to mention in this Tweet, e.g., @gigya.
defaultTextstringIf defined, this parameter overrides the default text to include in the Tweet when sharing from the site.
langstringThe language for the Tweet button.
relatedstringRelated 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':
titlestringA CSS selector that refers to the title of the article.
authorstringA CSS selector that refers to the author of the article.
publishedstringA CSS selector that refers to the published date of the article, format: yyyy-mm-dd.
contentstringA CSS selector that refers to the content of the article.
excludestringA CSS selector that refers to the containers that need to be excluded from the content area.
asinstringA link to Amazon Standard ID Number.
  Notes:
  • In addition to using Custom CSS Selectors, y ou 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 Guide.
  • 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':
categoryIDstringThe 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. 
streamIDstringThe identifier of the Comments stream for which the comments button is displayed. This 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':
callToActionLabelstringThe 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".
callToActionURLstringThe 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'.
callToActionDeepLinkIDstringThe 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. 
clientIDstringThe OAuth 2.0 client ID that was obtained from the Google APIs Console, e.g. 'xxxx.apps.googleusercontent.com'. 
contentURLstringThe 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/'.
contentDeepLinkIDstringThe 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.
cookiePolicystringDirects 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.
preFillTextstringThe 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.
  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':
sizestringThe 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':
widthintegerDefines the width of the button.
heightintegerDefines the height of the button.
annotationstringThe 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:

 The following field is relevant only if provider='moshare-sms':
iconsOnlyBooleanThis parameter determines whether the moShare button is displayed as icon only, without text and borders. The default value of this parameter is 'false'.
 The following field is relevant only if provider='pinterest-pinit': 
shapestringThis parameter determines the shape of the  Pinterest pin-it  button. Accepts the following values: "rectangular" (default if not set), or "round". Note that if  "round"  is specified, the counter will not be supported.
 These following fields are relevant only if provider='foursquare-save':
vidstringA foursquare venue ID.
variantstringThe button size to render. Can be either undefined or "wide".
hideTooltipBooleanThe default value is "false". When set to "true" shows description tooltip on hover.
 These following fields are relevant only if provider='tvtag' (formerly GetGlue):   
urlstringA 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.
titlestringThe title of the object being shared.
messagestringA custom message.
 These following fields are relevant only if provider='hatena-bookmark':     
lang        string        The 'hatena-bookmark' button's default language is Japanese. Explicitly set lang: 'en' to display the button text in english.
titlestringCustomize the 'data-hatena-bookmark-title' parameter.

 

Popup Customization Code Example

gigya.socialize.showShareBarUI({
    containerID: 'shareBar',
    shareButtons: [
        {
            // Full screen using percentage.
            provider: 'facebook',
            popupWidth: '100%',
            popupHeight: '100%'
        },
        {
            // Custom size in pixels.
            provider: 'twitter',
            popupWidth: '500px',
            popupHeight: '400px'
        },
        {
            // Custom positioning at top left of screen.
            provider: 'linkedin',
            popupPositionX: 0,
            popupPositionY: 0
        }
    ],
    userAction: {
        title: 'Test',
        linkBack: 'http://www.gigya.com',
    }
});
/* ******************************************************* */
gigya.socialize.postBookmark({
    URL: 'http://www.gigya.com',
    userAction: {
        title: 'Test'
    },
    provider: 'twitter',
    popupWidth: '75%',
    popupHeight: '50%',
    popupPositionX: '50%',
    popupPositionY: '50%'
});

 

 

  • No labels