AddToSite

Documentation

Getting started

Two lines of HTML and the buttons work. This page explains what those two lines do, so that changing them later is obvious rather than guesswork.

The whole thing

Paste this where the buttons belong. That is the entire installation — there is no account, no key, and nothing to configure before it works.

<div class="ats_kit ats_kit_size_32">
  <a class="ats_button_facebook"></a>
  <a class="ats_button_x"></a>
  <a class="ats_button_email"></a>
  <a class="ats_dd"></a>
</div>
<script async src="//static.addtosite.com/widget.js"></script>

The div marks where the buttons go and which ones to show. The script turns those empty links into buttons. It is about 15.3KB gzipped and loads asynchronously, so it never holds up your page.

Choosing services

One line per service, and the order in your markup is the order on the page. Leave the kit empty and you get a sensible default: Facebook, X, LinkedIn, WhatsApp, Telegram, Email, Copy Link.

The last line, ats_dd, is the More button. It opens a searchable menu of everything else, so leaving a service out of the row does not put it out of reach. Most pages are better with four or five buttons and the menu than with fifteen buttons.

Changing how they look

Size and shape are classes on the container, so they need no configuration:

ClassEffect
ats_kit_size_16_40Button size in pixels
ats_round_styleCircular buttons
ats_square_styleSquare corners
ats_floating_style ats_floating_style_leftPinned to the left edge; becomes a bottom bar on phones

Everything else lives in one object, set before the script runs:

<script>
  window.ats_config = { counters: true, num_services: 5 };
</script>

Sharing the right page

By default a button shares the page it sits on, taking the address from your canonical link if you have one. On a listing page, where each row should share its own article, say so per kit:

<div class="ats_kit"
     data-url="https://example.com/article"
     data-title="The article title">

This is the single most common mistake: buttons on a blog index that all share the index. If your sharing numbers look strangely concentrated on one URL, this is why.

Where it will not work

Email clients strip JavaScript, so newsletters need theemail build — plain links around images. Some hosted platforms strip scripts from post content too; theconfigurator has a plain-links mode for those, and each platform guide says which case it falls into.

Next