Support > Advanced Topics > Using HTML embed code parameters to alter store locator software behavior

Using HTML embed code parameters to alter store locator software behavior

The HTML Embed code is the piece of HTML which is added to your web page to display your store locator. You can add additional parameters to this embed code to configure certain aspects of the locator such as it's initial starting position and zoom level, to preset or hide Filters and Categories and also to conduct an initial address search.
To add a parameter, you will need to edit the embed code on your web page. For example, to add the 'data-address' parameter, you would add the following in bold:

 

<div id="storelocatorwidget" style="width:100%;"><p>Loading <a href="https://www.storelocatorwidgets.com">Locator Software</a>...</p></div><script type="text/javascript" src="//cdn.storelocatorwidgets.com/widget/mapbox-gl.js"></script><script type="text/javascript" id="storelocatorscript" data-uid="YOUR_EMBED_CODE" data-address="Denver Colorado" data-platform="MapTiler" src="//cdn.storelocatorwidgets.com/widget/widget.js"></script>

 

Here's the full list of available parameters:

General parameters

  • data-uid - (required) identifies your account
  • data-filters - preset any of the Filters, separate multiple filters with a comma. Filters do not need to be visible for this to work.
  • data-lockedfilters - this is the same as the above except the Filters are locked on. This works well if you have hidden filters that need to stay applied.
  • data-hiddenfilters - these Filters are hidden from display. You can still preset them or lock them using the above parameters if you wish.
  • data-categories - preset any of the Categories, separate multiple categories with a comma. Categories do not need to be visible for this to work.
  • data-hiddencategories - As per the data-hiddenfilters parameter, this hides Categories from view.
  • data-language - set the language to use if you have defined multiple languages
  • data-settings - override settings in your locator such as the store locator Layout
Setting the initial map position
  • data-lat - latitude
  • data-lng - longitude
  • data-zoom - zoom level
Searching for an address at load
  • data-address - search for this address 
  • data-droppin - set to false if you don't want to drop a user location pin after the search
  • data-radius - set the search radius
  • data-store - display store by name at page load

It's possible to add these parameters to your HTML installation code manually but we now recommend using our Embed Code Builder which does all the work for you. You can find this here: https://www.storelocatorwidgets.com/admin/embedcodebuilder.