API generated page content not showing up in site search results

Hi,

We have a few pages on our HubSpot hosted website that come from APIs - these are either purchasable products (that we’re selling through Shopify) or purchasable products (that we’re selling through Arlo). For these the listing pages and ‘more details’ page for each product is coming from an API of sorts and therefore javascript rather than HTML.

The out the box HubSpot site search only crawls HTML, I’m wondering if anyone knows of a way that we can also have it look at the javascript pages?

I’d like someone to be able to use the site search to look for our publications or courses and be taken to the relevant details pages. Currently it says “no result found” which is less than ideal.

Any suggestions welcome?

Hi @NTunnicliffe

Unfortunately, HubSpot’s out of the box site search tool is not capable of crawling JavaScript-generated pages, as it relies on HTML content to generate search results.
However, there are a few potential workarounds you could explore:
Create a custom search function that can crawl the API-generated pages: Depending on your technical expertise, you may be able to create a custom search function using a tool like Elasticsearch that can crawl the API-generated pages and return relevant search results. However, this will require some programming knowledge and likely some additional setup and configuration.
Use a third-party search tool that can crawl JavaScript-generated pages: There are several third-party search tools available that are designed to crawl JavaScript-generated pages, such as Algolia or Swiftype. You may be able to integrate one of these tools into your HubSpot site to provide more robust search functionality.
Use a hybrid solution: If creating a custom search function or integrating a third-party tool is not feasible, you could consider creating static HTML pages for your API-generated content and linking to those pages from your JavaScript-generated pages. This would allow your content to be crawled by HubSpot’s site search tool while still providing a seamless user experience.
I hope these suggestions are helpful and give you some ideas for how to improve your site search functionality!

Please mark it as SOLUTION ACCEPTED if you like the solution.

Thank You!