Embed Gola Discussions
Drop a live, interactive thread into any webpage with two HTML lines. No iframe. No heavy JavaScript framework. ~8 KB transferred.
Quick start
Paste anywhere in your HTML — that's it.
<div class="gola-embed"
data-thread="your-thread-slug"
data-theme="light"
data-height="520">
</div>
<script src="https://www.golaforum.com/widget.js" async></script>Replace your-thread-slug with the slug from your thread URL (e.g. liverpool-vs-city-recap).
Attributes
| Attribute | Values | Notes |
|---|---|---|
| data-thread | Thread slug or UUID | Required. Found in the thread URL: golaforum.com/thread/your-slug |
| data-theme | "light""dark" | Defaults to "light" if omitted. Pick whichever matches your site's colour scheme. |
| data-height | Integer (pixels) | Fixed pixel height of the widget. Defaults to 520, minimum 300. The compose bar is pinned at the top; replies scroll internally below it. |
Public threads only. Threads in private or restricted communities will show a locked placeholder instead of the discussion.
Multiple widgets on one page
One script tag, any number of embeds.
<!-- Two widgets, different heights --> <div class="gola-embed" data-thread="match-recap-slug" data-theme="dark" data-height="600"></div> <div class="gola-embed" data-thread="transfer-news-slug" data-theme="light" data-height="480"></div> <!-- One script tag handles all widgets on the page --> <script src="https://www.golaforum.com/widget.js" async></script>
Each widget is independently lazy-loaded via IntersectionObserver — only widgets scrolled within 200 px of the viewport fetch their data. If a visitor signs in through any one widget, all widgets on the page become authenticated automatically.
How it works
Shadow DOM — no style leaks
The widget renders inside a Shadow DOM root attached to your div. Your page's CSS cannot affect the widget and the widget's CSS cannot affect your page — guaranteed isolation with no iframe overhead.
Tiny footprint
The entire widget is ~8 KB gzipped — plain JavaScript, no framework, no bundler required. It runs in the same thread as your page and shares the browser's HTTP cache, so repeat visitors pay near-zero cost.
CDN-cached API responses
Thread and reply data is served with stale-while-revalidate caching — the first visitor fetches fresh data; subsequent visitors within 30 seconds get an instant cached response from the CDN edge.
Authentication via popup
Visitors who want to vote or reply click "Join the discussion". A small popup opens to golafootball.com for sign-in, then closes automatically. No page reload. No redirect. The JWT is passed back to the widget via postMessage.
Compose at the top
The compose bar is always visible at the top of the widget — visitors never have to scroll to find the input. Replies live in the scrollable area below. “Load more” appends older replies without changing the widget's footprint on your page.
Width
The widget fills the width of its container. Wrap it in a constrained element to control width:
<div style="max-width:680px">…</div>Getting your snippet from the forum
You can build the snippet by hand (just replace the slug), or grab it from the forum in two clicks:
During thread creation
On the Create Post page, toggle Make embeddable before clicking Post. After posting, a modal shows your ready-to-copy snippet with the Light / Dark toggle.
From an existing thread
Open any public thread, click the ⋯ Options menu (top-right), and select Embed Thread. The same snippet modal opens.