Sharing Customization
Single - Share Specific Page
Use the following code to have AddToAny to share a specific link.
Using data attributes
Set the page URL in the data-a2a-url
attribute, and set the page title in the data-a2a-title
attribute.
<div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-url="http://www.example.com/page.html" data-a2a-title="Example Page"> <a class="a2a_button_facebook"></a> <a class="a2a_button_mastodon"></a> <a class="a2a_dd" href="https://www.addtoany.com/share"></a> </div> <script defer src="https://static.addtoany.com/menu/page.js"></script>
Without data attributes
The previous example uses data attributes and is the recommended method for efficiently loading AddToAny
The following example is a more complex method using JavaScript instead of data attributes.
<div class="a2a_kit a2a_kit_size_32 a2a_default_style"> <a class="a2a_button_facebook"></a> <a class="a2a_button_mastodon"></a> <a class="a2a_dd" href="https://www.addtoany.com/share"></a> </div> <script> var a2a_config = a2a_config || {}; a2a_config.linkname = 'Example Page'; a2a_config.linkurl = 'http://www.example.com/page.html'; </script> <script defer src="https://static.addtoany.com/menu/page.js"></script>