Sharing Customization

Multiple Instances - Share Different Pages

Use the following code as a template for configuring multiple instances to share different links.

Using data attributes

<div>Share Page 1:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-url="http://www.example.com/page_1.html" data-a2a-title="Example Page 1">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<div>Share Page 2:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-url="http://www.example.com/page_2.html" data-a2a-title="Example Page 2">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<div>Share Page 3:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style" data-a2a-url="http://www.example.com/page_3.html" data-a2a-title="Example Page 3">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<script async src="https://static.addtoany.com/menu/page.js"></script>

For details, see the full configuration example.

Share Page 1:

Share Page 2:

Share Page 3:

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 and less efficient method using JavaScript instead of data attributes.

<div>Share Page 1:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<script>
var a2a_config = a2a_config || {};
a2a_config.linkname = 'Example Page 1';
a2a_config.linkurl = 'http://www.example.com/page_1.html';
</script>

<script src="https://static.addtoany.com/menu/page.js"></script>

<div>Share Page 2:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<script>
a2a_config.linkname = 'Example Page 2';
a2a_config.linkurl = 'http://www.example.com/page_2.html';
a2a.init('page');
</script>

<div>Share Page 3:</div>

<div class="a2a_kit a2a_kit_size_32 a2a_default_style">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_dd" href="https://www.addtoany.com/share"></a>
</div>

<script>
a2a_config.linkname = 'Example Page 3';
a2a_config.linkurl = 'http://www.example.com/page_3.html';
a2a.init('page');
</script>

For details, see the full configuration example.

Share Page 1:

Share Page 2:

Share Page 3: