FastComments.com

Add Live Commenting to Bubble.io Sites

What This Guide Covers

This guide covers setting up live commenting with FastComments on Bubble.io.

1. Add HTML Block Internal Link

First, navigate to the page/layout where you want to add FastComments. In the Bubble editor, drag and drop an HTML element from the Visual Elements sidebar onto your page.

Add HTML Element
Adding HTML Element to Bubble Page

The HTML element will allow us to embed the FastComments widget directly into your Bubble app.

2. Insert Code Internal Link

Click on the HTML element you just added. In the property editor that appears, paste the following code into the HTML field:

Bubble.io Live Commenting Code Snippet
Copy Copy
1
2<script src="https://cdn.fastcomments.com/js/embed-v2.min.js"></script>
3<div id="fastcomments-widget" style="width: 100%;height: 100%;"></div>
4<script>
5 (function fcLoad() {
6 function tryLoad() {
7 // bubble tends to change the code snippet to be async
8 const container = document.getElementById('fastcomments-widget');
9 if (!container) {
10 return waitRetry();
11 }
12 if (!window.FastCommentsUI) {
13 return waitRetry();
14 }
15 if (container.fastCommentsSetup) {
16 return;
17 }
18 window.FastCommentsUI(container, {
19 tenantId: 'demo',
20 pageTitle: top.document.title,
21 url: top.location.href,
22 urlId: top.location.pathname
23 });
24 container.fastCommentsSetup = true;
25 }
26 function waitRetry() {
27 setTimeout(tryLoad, 500);
28 }
29 tryLoad();
30 })();
31</script>
32
Insert FastComments Code
Inserting FastComments Code into HTML Element

Note: This code includes a retry mechanism to ensure FastComments loads properly in Bubble's dynamic environment. Other code snippets will not work.

Remember to replace 'demo' with your actual FastComments tenant ID after signing up. If you're logged in to FastComments.com, it should already be replaced.

3. Find Width Setting Internal Link

To ensure the comment widget displays properly, we need to adjust the HTML element's width. Look for the Layout tab in the element's property editor.

Find Width Setting
Finding the Width Setting in Layout Tab

The Layout tab contains important sizing options that will help our comment widget display correctly across different screen sizes.

4. Adjust Layout Internal Link

In the Layout tab, set the width to 100%. This ensures the comment widget takes up the full width of its container and responds properly to different screen sizes.

Set Width to 100%
Setting HTML Element Width to 100%

After changing the input value to 100 (or the desired percentage) you'll have to click the dropdown next to the number to change it from pixels to percentage.

Also, set a minimum height (e.g., 400px) to ensure the comment widget has enough space to display properly.

After making these changes, click the Preview button to see your FastComments widget in action!

Success Internal Link

Nice work! You've added live commenting to your Bubble.io site.

If you've run into a permission denied error, or would like to customize FastComments, read on.

Customization Internal Link

FastComments is designed to be customized to match your site.

If you'd like to add custom styling, or tweak configuration, Checkout our Customization Documentation to learn how.