Google Custom Search integration does not show search results until the page is refreshed

I have the paid version of Google Custom Search integrated into my site (www.targethealth.com). When I submit a search from the topnav bar, I get different results based on the browser being used:

  • Chrome: result page appears and after a brief pause the search results appear

  • IE 11: result page appears and after a 1 second plus pause the search results appear

  • Edge: result page appears, but results do not render. If the page is refreshed, the results magically appear

Not sure if this is a performance issue with Google Custom Search, a configuration issue, or both. Any help in debugging this behavior would be greatly appreciated.

My system setup is the latest versions of Chrome and Win10.

Here is a sharing link to the site:

https://preview.webflow.com/preview/target-health-staging?preview=7fa67862733c395af2fd6e98d24d02c6

Ignoring the pause, your site search seems fine on all three browsers (latest versions), on Windows 10.

Thanks for checking the issue out @samliew. Have you integrated Google Custom Search into a site before and experienced this delay?

Thanks
Murray

A delay is expected, as data needs to be sent and await a response from Google.

Chrome Dev Tools Console is showing the following error. Are there any configurations that I can make in Webflow or Google Custome Search to address this?

Seems like those are ads, does it prevent the results from showing?

You have this script code multiple times, try putting this once in your site’s head:

<script>
  (function() {
    var cx = '007334364937416712831:1tkzq0z0fvu';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>

And then in the “HTML Embed” sections in your design, only

<gcse:searchbox-only></gcse:searchbox-only>

or

<gcse:searchresults-only></gcse:searchresults-only>

as needed.

With Google Custom Search going away, it’s time to check out Webflow’s integrated search!

This topic was automatically closed after 8 hours. New replies are no longer allowed.