Skip to content

JavaScript embed

The JavaScript embed is the normal way to put a ticker on a page. It works on any site that lets you paste a <script> tag: a CMS, a static site, a landing page builder.

Copy it from the ticker’s Embed dialog; it already carries the right ticker id.

<script defer
src="https://cdn.livetickr.io/embed.js"
id="livetickr-feed"
data-ticker-id="YOUR_TICKER_ID"></script>

Paste it into your page where the feed should appear. The script renders the ticker in place of the tag, so its position in the markup is the position on the page.

Attribute What it does
src Loads the embed script, and tells it which host to fetch the feed from. Both come from the same origin, which is what keeps the embed cookieless.
id Must stay livetickr-feed. The script finds itself by this id to know where to render.
data-ticker-id Which ticker to show.
defer Lets the page finish parsing first. The embed never blocks your page.

Do not change src by hand. Whichever host serves embed.js also serves the feed behind it, so a hand-edited URL breaks both halves at once.

The script loads the most recent 10 updates and renders them. Load more adds 10 at a time.

It then polls for changes every 15 seconds. A new update you publish appears on every page that embeds the ticker within that window, with no rebuild and no cache to clear on your side.

Nothing is written to the reader’s browser for the feed itself: no cookie is set, and readers are not identified across pages or devices.

If an update embeds a post from somewhere else, a tweet or a video, that content is not loaded straight away. The reader sees a placeholder, and the third party is contacted only once they opt in.

The opt-in covers the whole feed, is remembered in the reader’s own browser, and can be switched back off. This is on by default; a workspace can turn it off in its appearance settings, in which case third-party content loads immediately.

By default a snippet works wherever it is pasted. In the workspace settings you can set an output domain, after which the feed only renders on that domain and its subdomains. Anywhere else, a copied snippet renders nothing and records no statistics.

localhost and 127.0.0.1 are always allowed, so a local build of your site keeps working while you develop.

Almost always one of three things:

The ticker is still a draft. Drafts are not served, that being what draft means, so the snippet is correct and there is simply nothing to show. Set the ticker live.

The ticker id is wrong. A mistyped or non-existent id answers 404, and embed.js says so in the browser console. Copy the snippet from the Embed dialog again rather than editing it by hand.

The ticker was taken offline. A ticker that was live and is now back to draft answers 410, not 404, and readers see a short “no longer available” notice instead of an empty space. If that was not intentional, set it live again.

The distinction matters when you are debugging: 404 means the snippet is wrong, 410 means the snippet is right and the feed was withdrawn.