Share buttons that stay out of the way.no account required
AddToSite

← All customization

Behind the scenes

Serve the widget from your domain

Some content policies do not allow a third-party script tag at all. Download the zip, put its folder on your own origin and point the tag at it — the widget works out where its icons and its overlay code live from its own address, so nothing else has to be told where anything is.

Download addtosite-selfhost.zip298 KB · 242 files · build 202610122025

The code

<div class="ats_kit ats_kit_size_32">
  <a class="ats_btn_facebook"></a>
  <a class="ats_btn_x"></a>
  <a class="ats_btn_linkedin"></a>
  <a class="ats_btn_whatsapp"></a>
  <a class="ats_dd"></a>
</div>

What to watch for

Pin a version when you self-host, and update deliberately — nothing will update it for you.

What is in the zip

One folder, addtosite/, built from the same files static.addtosite.com serves. The script finds its companion files relative to its own src, which is why they have to travel together.

  • addtosite/
    • widget.jsthe script itself
    • icons.jsonthe long tail of brand glyphs, fetched on demand
    • overlays.jsimage overlays, fetched only if you switch them on
    • share-tools.jsWeChat QR and WordPress chooser, fetched when used
    • img/one SVG and two PNGs per service, for the no-script and email snippets
      • facebook.svg
      • facebook-32.png
      • facebook-64.png
      • …the same three for every service
    • README.txtthe build it came from and the tag to use

The tag

Same attributes, your address.

<script async src="/vendor/addtosite/widget.js"></script>

Pin a version and update deliberately

Nothing will update a copy on your own server, which is the point of having one. Note which version you took — the script reports it as addtosite.version — and treat an update as a deployment rather than as something that happens to you.

Counting is a separate decision

Serving the script yourself does not move the counting: that is still our host unless you name your own. A policy that bars a third-party script usually bars the third-party request too.

Live demo

An article worth passing on

This page loads the widget the ordinary way. Self-hosting changes the address in the tag and nothing else about the markup.

Services (4 selected)

Button size

Shape

Behaviour

<div class="ats_kit ats_kit_size_32">
  <a class="ats_btn_facebook"></a>
  <a class="ats_btn_x"></a>
  <a class="ats_btn_linkedin"></a>
  <a class="ats_btn_whatsapp"></a>
  <a class="ats_dd"></a>
</div>

<script async src="//static.addtosite.com/widget.js"></script>

Related

More in Behind the scenes