Specifying the URL to be Shared


Share Buttons automatically evaluate the webpage they are placed on for signals for the best URL to share.

For non-index pages (ie. pages that contain a single piece of content for sharing), the following signals are evaluated in this specific order:

  1. "data-link" attribute
    <div class='shareaholic-canvas' data-app='share_buttons' data-app-id="xxx" data-title='Page Title' data-link='http://www.yourwebsite.com/'></div>
    Note: if you're using either our WordPress or Drupal plugin, data-link is set automatically.

  2. Shareaholic URL Meta Tag
    <meta name="shareaholic:url" content="http://www.yourwebsite.com/" />
    Note: if you're using either our WordPress or Drupal plugin, this meta tag is set automatically.

  3. Canonical Meta Tag
    <link rel="canonical" href="https://blog.example.com/dresses/green-dresses-are-awesome" />
  4. Open Graph URL Meta Tag
    <meta name="og:url" content="http://www.yourwebsite.com/" />
  5. The URL displayed in the web browser address bar

For index pages, it is best to use the data-link attribute when placing Share Buttons on a webpage. If the data-link attribute is not utilized, Share Buttons automatically determines the URL to be shared based on a number of factors, including page structure. Note: if you're using either our WordPress or Drupal plugin, this is taken care of automatically for you.

Was this article helpful?