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

← All customization

The menu

Remember preferred services

Save an ordered set of service keys in the reader’s browser. Those services appear ahead of the remaining catalog whenever the menu opens, after any priority explicitly chosen by the publisher.

The code

<div class="ats_kit ats_kit_size_32">
  <a class="ats_dd"></a>
</div>

<div class="mt-4 flex flex-wrap gap-2"><button type="button" id="ats-prefer-demo" class="btn btn-primary">Prefer WhatsApp, Telegram and Email</button><button type="button" id="ats-clear-preferences" class="btn btn-outline">Clear preferences</button></div><p id="ats-preference-status" class="mt-3 text-sm" role="status">No preference changes until you press a button.</p>

Read, save and clear

The getter returns a copy. The setter accepts an ordered array, removes duplicates and unknown or follow-only keys, and returns the saved order. No preference is saved automatically just because a service was clicked.

addtosite.preferences();
addtosite.preferences(["whatsapp", "telegram", "email"]);
addtosite.preferences([]);

Where preferences live

The localStorage key is ats-preferred-services. Storage belongs to the origin of the page embedding the widget, including its scheme, hostname and port. Preferences on AddToSite do not travel to unrelated websites. If storage is unavailable, the current page can still remember its selection in memory.

Publisher settings win

Explicit priority comes first, then saved preferences, then catalog order. Allow/exclude lists and platform availability still apply. Saved order changes menus; it does not reorder service anchors the publisher wrote by hand.

window.ats_config = window.ats_config || {};
window.ats_config.priority = ["email"];

Live demo

An article worth passing on

No preference changes until you press a button.

Choose a preference, then press More. This changes the saved service order on the current site; Clear preferences removes that order.

Button size

Shape

Behaviour

snippet.html
<script>
window.ats_config = window.ats_config || {};
window.ats_config.native = false;
window.ats_config.track = false;
window.ats_config.analytics = false;
</script>

<div class="ats_kit ats_kit_size_32">
  <a class="ats_dd"></a>
</div>

<div class="mt-4 flex flex-wrap gap-2"><button type="button" id="ats-prefer-demo" class="btn btn-primary">Prefer WhatsApp, Telegram and Email</button><button type="button" id="ats-clear-preferences" class="btn btn-outline">Clear preferences</button></div><p id="ats-preference-status" class="mt-3 text-sm" role="status">No preference changes until you press a button.</p>

<script>
window.ats_config = window.ats_config || {};
document.addEventListener('click', function (event) {
  var save = event.target.closest('#ats-prefer-demo');
  var clear = event.target.closest('#ats-clear-preferences');
  if ((!save && !clear) || !window.addtosite) return;
  window.addtosite.preferences(save ? ['whatsapp', 'telegram', 'email'] : []);
  var status = document.getElementById('ats-preference-status');
  if (status) status.textContent = save ? 'Preferences saved on this site. Open More to see the order.' : 'Saved preferences cleared on this site.';
});
</script>

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

Related

More in The menu