Shopify - How to Enable SEO Friendly URL's

In Shopify, you will need to add a new page for your store locator with the code provided to you from your OneBark dashboard. Once added, you will also need to add another line of code to a theme file. Follow the steps below and please reach out if you have any questions. We are happy to get the store locator setup and working on your Shopify site for you.

INSTRUCTIONS

PART 1

  • Log in to your Shopify store dashboard, click on 'Online Store' in the Left Menu.
  • Select 'Pages' and create your store page
  • Go to your OneBark dashboard and under 'Store Locator' click on 'Settings > Generate Code' tab.
  • Copy the code, and add the code to this new or existing Shopify page using the text editor code section (click the button that says Show HTML to then add the code to the page)
  • Save the page

PART 2

  • In Shopify, navigate to the theme editor by selecting 'Themes' from the left menu under online store in Shopify
  • Click on action dropdown of current theme and select 'Edit Code'
  • Open the following file(s) under Templates in theme editor:
      1. page.liquid file
      2. theme.liquid file


  • Go to Onebark dashboard -> left menu -> setting -> generate code and copy code from point-2 code box.
  • Paste the code to the page.liquid file on line number 1 as shown in the above image and save the file
  • Add the following code to the theme.liquid file after first <script>tag in the code.
<code data-v-37477c6a="" id="script_tag2">
function onebarkStoreLocator(){
var store_locator_url='<your-store-locator-url>';
eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('7 3=8.d.c;5(3.6(\'?\')){}g{5(3.6(2)){7 4=3.9(2).a(\'\');5(4!=""){2=2.b(0,-1);8.d.c=2+\'#\'+4}}2=2.b(0,-1);5(3.6(2+"#")){7 4=3.9(2+"#").a(\'\');8.e.f({},\'\',2+\'/\'+4)}}',17,17,'||store_locator_url|wl|param|if|includes|var|window|split|join|slice|href|location|history|pushState|else'.split('|'),0,{}))
}
onebarkStoreLocator();</your-store-locator-url>

Replace <YOUR-STORE-LOCATOR-URL> with Shopify store locator page URL and save the theme.liquid file.

----------

TROUBLESHOOTING

The general rule is to map everything after slash on the store page to the store page itself, i.e.: www.mywebsite.com/store-locator/anythingwww.mywebsite.com/store-locator

Specific configuration depends on your server:

If you need additional help, please contact us for assistance.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us