Skip to content

feat: add Intercom widget to rails world 2025 pages #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ibramsterdam
Copy link
Contributor

Context

Every year, people who come to Rails World have questions about the conference and tickets. Right now, @AmandaPerino answers all these questions, so her inbox gets very full. This year, we want to use Intercom to help with this problem.

This pull request adds the Intercom Widget to the header of the 2025 pages.

Note: Right now, this widget is set to be off within Intercom. If this pull request is merged and deployed, you will not see any changes yet. There is still work to do in Intercom. For example, we need to create a knowledge base for Fin.

How it looks on the website

widget_example.mp4

Intercom article

https://www.intercom.com/help/en/articles/167-install-intercom-for-visitors-and-leads-on-web

@AmandaPerino
Copy link
Collaborator

Thank you @ibramsterdam! Will ask someone from the Rails teams to review and then we can hold until ready for merging.

Copy link
Member

@akhilgkrishnan akhilgkrishnan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ibramsterdam Thanks for the change

@flavorjones
Copy link
Member

@AmandaPerino
Copy link
Collaborator

Thank you both @akhilgkrishnan & @flavorjones! Will work with @ibramsterdam on a good day to merge.

@flavorjones
Copy link
Member

flavorjones commented May 29, 2025

Maybe one comment: the widget loads late in the video (after the full page has been rendered). This 800-1000ms delay makes the site feel janky, especially when the rest of the site is already cached and renders in under 100ms.

Would it be worth considering spending some time to try to speed this up? It looks like the intercom widget only loads once the page's readyState is complete, and the bottleneck to that seems to be the hotwire assets which are hosted on a CDN:

image

An alternative might be to intentionally delay the widget appearing (to something like 5 seconds).

@flavorjones
Copy link
Member

flavorjones commented May 29, 2025

Using a CDN that doesn't redirect and is properly cached helps a lot. Here's the one that's recommended in the turbo docs:

diff --git a/_includes/world/2025/head.html b/_includes/world/2025/head.html
index ceb38551..eb399c51 100644
--- a/_includes/world/2025/head.html
+++ b/_includes/world/2025/head.html
@@ -62,7 +62,7 @@
   <script src="/assets/world/2023/scripts/modal_component.js" defer></script>
 
   <script type="module">
-    import hotwiredTurbo from 'https://cdn.skypack.dev/@hotwired/turbo';
+    import hotwiredTurbo from 'https://cdn.jsdelivr.net/npm/@hotwired/turbo@latest/dist/turbo.es2017-esm.min.js';
   </script>
 
   <script type="text/javascript">

and now everything loads about 500ms faster.

@ibramsterdam
Copy link
Contributor Author

@flavorjones Thank you for your feedback! Do you want me to include your suggestion in this PR?
I am a little unsure how to proceed because Rafael has already approved the current version of the PR

@AmandaPerino
Copy link
Collaborator

Do you want me to include your suggestion in this PR?

Let's go for it @ibramsterdam. We have time to get any additional changes reviewed again, and it feels worth the additional effort.

@ibramsterdam
Copy link
Contributor Author

Works great! Thanks @flavorjones ☺️

cached-hotwire-example.mp4

@ibramsterdam ibramsterdam requested a review from rafaelfranca May 29, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants