Forum Documentation Showcase Pricing Learn more

Disqus plug-in: How does Bubble enable/ensure separate comment threads?

I just installed the Disqus plug-in and was pleasantly surprised to find that for one “page” that I designed in Bubble, each dynamically-generated “version” of that page (I’m building a tournament app, so by version I mean Matchup A, Matchup B, Matchup C, etc., where the page is “matchup”) gets its own unique Disqus thread. This is perfect for me. However, I would like to understand exactly how the system works to enable this behavior, and any limitations/watchouts I should be aware of before I go all in on Bubble.

Is the “Type of Content” field of the page (e.g., “Matchup”) plus the Bubble-assigned uniqueID of whatever specific content is sent to that field by a preceding page (e.g., “Matchup A” | id=1444719588122x964794839015854700) being used to determine the URL that Disqus uses to filter/organize its comments? Tough to tell in free/evaluation mode but the URL looks to me to be //my-app/version-test/matchup?id=1444719588122x964794839015854700. I’m so used to Wordpress/permalinks that I can’t get my head around this. What if there’s another parameter passed to the page (e.g., &ref=cnn)? How does Disqus handle it? It wouldn’t start a new comment thread, right?

I guess there’s a more general question in there about how Bubble’s URLs are structured.

Thanks in advance to anyone who takes the time to try to explain it or who can point me to the right section of Bubble’s documentation.

-Ed

When you send a data to a page, we put the ID in the URL and use this id to retrieve the ‘Current page’s thing’. We’ll work at some point on making them more readable, but that’s fundamentally the spirit.

not sure how disqus handles it to be honest (it’s more a question for them/their documentation). On the Bubble side, if there is more than one parameter it’s kept, but the only what that really matters in Bubble is the id.

Thanks for the quick reply. That makes sense. But now I do worry that you guys will need to make some other functionality available before the Disqus plugin becomes truly viable. While it does seem to work fine at the moment, if you were to change the way you generate URLs (to make them “more readable”) down the line, then you would break the link between a Bubble page and its Disqus thread and cause some serious headaches for your users who rely on the plugin.

I read the Disqus documentation (https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables) and it appears that by allowing a user to define, at minimum, the dynamic disqus_identifier in addition to simply the shortname, that would maintain the link between Bubble page and its Disqus thread no matter what you did to the URL syntax. For example, I could set my disqus_identifier for a given page to “Current Page’s thing” or something even more complicated if I wished, where Disqus would simply read that Bubble output as its input to pull the right thread.

In all, Disqus recommends passing all five of the following as variables:

disqus_shortname (done!)
disqus_identifier
disqus_title
disqus_url
disqus_category_id

Would be great to be able to do that within Bubble. Short of that, it would be great if you held off on changing your URL syntax in any way until this was done! :wink:

Regards,

-Ed

Good idea, we’ll deploy an update later today or tomorrow.

1 Like

Awesome. I’ll happily test it for you. Thanks!

Should be live now

Cool! So … I see the new fields, which is great. However, all I can input is plain text into the input boxes. To really make it work, each field (save perhaps Disqus Category) would need to accept Dynamic input as most of your other fields do. Not sure if that makes it a bigger change or not …

Really appreciate you investigating/implementing this. I’m beyond impressed with Bubble in my ~25 days with it so far.

-Ed

Not sure Disqus’ plugin would handle well changing things dynamically. How dynamic would the changes be? Hardcoded by you? Or users would be able to type their own shortname?

Sorry, short name should not be dynamic. That is basically a website lookup and would not vary. You enter it once and you’re done, as you have today.

But when I say the other fields should be dynamic, that is only to serve the purpose of representing the correct version of the Bubble page to Disqus. As far as Disqus can tell, the page identifiers would be stable (despite being “dynamic” in Bubble terms).

For my use case, I would simply set the Disqus identifier to “This Page’s Thing’s uniqueID”. And then I’d be done. In doing so, whenever the Bubble page loads (with a dynamically selected Thing passed to it by another page), the correct Disqus thread related to that Thing comes with it.

For example, let’s say you’re building a craft beer discussion app. From the Select a Beer page, a user clicks on Great Grizzly Beer (the beer’s unique ID is 13579x24680, which the Bubble workflow passes to the next page). This navigates them to the app’s Discuss This Beer page for Great Grizzly Beer. On page load, the Disqus identifier, which I’ve set to This Page’s Beer’s uniqueID, which renders as 13579x24680, is sent to Disqus to load the right comment thread.

This sequence is exactly what happens today via the URL created dynamically by Bubble, except gives me more control over what exactly Disqus sees and gives Bubble the ability to change its URL syntax down the line.

Just pushed this.

Excellent. Seems to work perfectly now. I inserted “Current Page’s Thing’s uniqueID” and Disqus pulls the correct comments thread exactly as expected. And just to test, when I put something random/static in there, Disqus doesn’t know what to do (as expected) – this tells me that the identifier field you added really is being passed to Disqus and being used.

Thanks so much for this. Added peace of mind as I get ready to commit to building my app on Bubble!

-Ed

1 Like