How to Customize Inline Share Buttons (Image, URL, and more)
Looking to customize the title, description, image, or URL that’s displayed when a user shares content on your website? You came to the right place! (If you want to learn how to customize your Sticky Share Buttons, go here)
Oftentimes, the Open Graph Protocol tags will populate this information with content from your page but you can tailor it to make it more relevant if it’s not extracting the information you want it to. For example, if a user shares your homepage, you may want to add an image of your product or provide a more compelling description.
Properties in <div> tags
You can specify the URL, title, image, and description that’s shared by adding the following tags in the tool placement code <div class=”sharethis-inline-share-buttons”></div> wherever you want the ShareThis tool to appear.
data-network | Specifies to which social platform the content will be shared |
data-url | Specifies URL (can be shortened URL) that you would like shared |
data-short-url | Specifies a shortened URL that can be used in conjunction with the data-url |
data-title | Specifies title that you would like shared (email’s subject in some email channels) |
data-image | Specifies link to image you would like displayed in the shared content |
data-description | Specifies summary text/description you wish to share |
data-username | Specifies your Twitter username |
data-message | Specifies the body copy of e-mail shares |
data-email-subject | Specifies the email’s subject |
Example: This button is set to share the ShareThis home page with the title “Sharing is great!”<div class="sharethis-inline-share-buttons" data-url="https://sharethis.com" data-title="Sharing is great!"></div>
Notes
- This customization is not available for all social channels.
- The data-url attribute will help you set a specific URL (despite which page users are sharing) or add a tracked link.
Order of Precedence
It is important to remember the order of precedence by which the ShareThis code processes share properties. Generally, we recommend using one approach by which sharing properties are specified on your pages to prevent errors.
- Any dynamically specified JavaScript properties (i.e. highest precedence)
- Properties specified in tags (i.e. second precedence)
- Open Graph Protocol tags (i.e. lowest precedence)