SEO Page Generator Best Practices

This topic applies to

Applies to

Commerce Web Stores

 

When you customize your Commerce web store, it is important you consider the following SEO page generator best practices:

  • Optimize your JavaScript and use minimal AJAX calls to shorten the time it takes to generate the page HTML. The optimized site can help improve ranking on search results pages because faster loading sites are ranked higher than slower sites.

    Note

    Commerce web stores must load in under 20 seconds.


  • After customizing a page, test it in all main browsers and resolve any JavaScript errors.

    Note

    You should consider the SEO page generator as another browser that should be tested in addition to Google Chrome, Mozilla Firefox, Safari, Microsoft Edge, or Internet Explorer. See Troubleshooting Your Website for troubleshooting tips and techniques.


  • You should exclude certain elements from SEO page generation. This is useful for embedded, third-party components with external URLs that might consume excessive JavaScript memory or repeatedly poll external URL.

    The following example demonstrates this exclusion:

    if(!SC.isPageGenerator()){ // Insert non-page generator content here }
  • Use jQuery instead of DOM for better results in the SEO page generator.

  • In the following situations, wrap the code in a statement to exclude it from SEO page generation:

    • You should not initialize UI intensive jQuery plug-ins on the SEO page generator because they might slow your page down.

    • You should not use the setTimeout() and setInterval() methods on the SEO page generator because they might cause the SEO page generator to timeout.

    • You should not use the animate() jQuery method on the SEO page generator.

    For example, you can wrap your code in a statement similar to the following to indicate that it is only for display in the browser:

    if(SC.ENVIRONMENT.jsEnvironment === 'browser'){ // Insert non-page generator content here }
  • Use only functions supported by the ECMAScript version 5(ES5) standard.

  • If you are making multiple HTTP requests, and you implicitly rely on certain order of execution, your code might be forced to non-expected code paths or states.