Search code examples
google-plusgoogle-plus-one

google +1 button - tell it to ignore hash parameters?


How do I pass options to the the google +1 button to use the base url, and ignore the hash parameters?


Solution

  • The documentation specifies three different methods of specifying the URL to get +1'd.

    1. The button's href attribute
    2. The page's <link rel="canonical" ... /> tag
    3. The URL provided by document.location.href (not recommended)

    The easiest way is to write <g:plusone href="..."></g:plusone>.