SEO Page Generator Best Practices

This topic applies to

Applies to

SuiteCommerce Web Stores

When you customize your site, it is important that you consider the following SEO page generator best practices:

  • The SEO page generator is a resource-constrained environment. Therefore, it is crucial to optimize your JavaScript to avoid reaching the memory and time limits. Optimized JavaScript and minimal AJAX calls can reduce the length of time it takes the SEO page generator to generate the HTML of the page. In turn, this optimized site can help improve ranking on search results pages, since faster loading sites can be ranked higher than slower sites.

  • After customizing a page, you must resolve all the JavaScript errors, and test the custom page in all browsers. 

    Note

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


  • If you are using a third-party component that is embedded using an external URL, and it repeatedly polls external URLs or consumes excessive JavaScript memory, wrap it in a statement indicating that it is not for the SEO page generator. For example:

    if(!SC.isPageGenerator()){
       // Insert non-page generator content here
    } 
  • The SEO page generator fully supports all DOM Level 2 functions and partially supports DOM Level 3 and DOM Level 4 functions. So while customizing a page, avoid using the unsupported functions. The following DOM functions are not supported by the SEO page generator.

    Document Objects

    Element Object

    Attribute Object

    Test Object

    DOM Level 2

    -

    -

    -

    -

    DOM Level 3

    getUserData()

    isDefaultNamespace()

    isEqualNode()

    isSameNode()

    lookupNamespaceURI()

    lookupPrefix()

    adoptNode()

    getFeature()

    renameNode()

    setUserData()

    getUserData()

    isDefaultNamespace()

    isEqualNode()

    isSameNode()

    lookupNamespaceURI()

    lookupPrefix()

    getUserData()

    isDefaultNamespace()

    isEqualNode()

    isSameNode()

    lookupNamespaceURI()

    lookupPrefix()

    getUserData()

    isDefaultNamespace()

    isEqualNode()

    isSameNode()

    lookupNamespaceURI()

    lookupPrefix()

    replaceWholeText()

    DOM Level 4

    isDefaultNamespace()

    isEqualNode()

    lookupNamespaceURI()

    lookupPrefix()

    getElementsByClassName()

    adoptNode()

    createNodeIterator()

    createTreeWalker()

    isDefaultNamespace()

    isEqualNode()

    lookupNamespaceURI()

    lookupPrefix()

    getElementsByClassName()

    Not Applicable

    isDefaultNamespace()

    isEqualNode()

    lookupNamespaceURI()

    lookupPrefix()

  • Since jQuery supports environments with minimal DOM support, you might get better results in the SEO page generator when you use jQuery instead of DOM.

  • Avoid using the append() jQuery method as it might cause problems with the SEO page generator.

  • In the following situations, you should wrap the code in a statement to indicate that it is not for the SEO page generator:

    • The localStorage APIs are not supported by the SEO page generator. An error message similar to the following will be displayed in the seodebug log if you use them:

      ReferenceError: localStorage is not defined
    • You should not initialize UI intensive jQuery plug-ins on the SEO page generator.

    • You should not use the setTimeout() and setInterval() methods on the SEO page generator, as 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
    } 
  • To prevent the SEO page generator from running out of memory:

    • Avoid adding excessive Facets or Facet Values.

    • Avoid using code that adds a lot of HTML.

  • You should not use functions that are not 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.