Adding a Website Location Search Feature

Wave2 has website search support built right in, so adding a Location Search feature to your website, either in your homepage or across all pages in your header or footer, should be a fairly straighforward task.

Just follow the steps below, and you'll be up and running in no time!
  1. Find your Website Location Search Code from the Wave2 Loctor Portal.
    • Login to the Portal at https://portal.wave2.io/
    • Go to the Integration Dashboard by clicking the big blue Integration button or by selecting it from the main menu.
    • From there, click on Website Location Search Code.
  2. Select the text input field labeled "Locations Page URL" and type in the full URL, including https:// , for your locations page that will display your Wave2 Locator.
  3. Click the "Update" button. This will customize the location search code with your URL. It should look like the sample code below.
  4. Open your website editor or Content Management System and open the appropriate page or component (header or footer, for example) for your website location search feature.
  5. Be sure you are directly editing the HTML Source of the page, not just using a WYSIWYG-style editing view. You will be pasting both HTML and Javascript into the source of your page. You must edit / paste into the HTML source directly or the code will not work.
  6. Paste the complete customized Location Search Code into your page HTML, exactly where you would like the searchbox to appear.  
  7. Style the search inputs, or supply your own, and apply appropriate CSS rules to match with the styles of your site.
That's it! After you publish the page, your location search box should be live, and it should take users to your locations page to load up the results of their search in the Wave2 Locator.

  1. <script type="text/javascript">
  2. var wave2locatorURL='YOUR FULL LOCATOR PAGE URL';
  3. document.getElementById('wave2search').onkeydown = function(event){
  4.     var e = event || window.event;
  5.     if(e.keyCode == 13) openSearch();
  6. }
  7. function openSearch(){
  8. var mysearch=document.getElementById('wave2search').value;
  9. top.location.href=wave2locatorURL + '?search='+mysearch;
  10. }
  11. </script>

  12. <input type="text" id="wave2search" placeholder="Enter City, State or Zip Code"/>
  13. <input type="button" id="wave2button" value="Search" onClick="openSearch();"/>