SEO Page Generator Debug Log

The SEO page generator gives you a comprehensive logging feature that lets you analyze the content of a page created by the server-side rendering (SSR) process. The log includes:

The debug log is a useful tool for developers and SEO experts who want to check that the page content that is being served to search engine crawlers is a faithful representation of the page that is served to human users, and that it is error free.

Viewing the SEO Page Generator Debug Log

The main mechanism for generating debug logs from the SEO page generator is to add the seodebug=T parameter to a SuiteCommerce web store page URL and then view its source.

To view the debug log provided by the SEO page generator:

  1. Go to the URL of the page you want to debug.

  2. Right-click on the page and click View page source.

  3. Modify the URL of the page and append ?seodebug=T as a URL parameter. If it is the only URL parameter, you need to use a question mark (?) first. If there are other parameters, you need to use an ampersand (&). For example, your URL will look something similar to the following:

    view-source:www.mywebstore.com/Salida-Backpack?seodebug=T

    view-source:www.mywebstore.com/Salida-Backpack?color=red&seodebug=T

  4. Press Enter to reload the page with the newly parameter added.

  5. After the page has loaded, scroll down the page to see the debug log created by the SEO page generator. It will look something similar to the following:

                      <!--
    Debug output:
    [09:12:15.780] [    +0 ms ] Requested URL with SEO generator relevant params: https://www.mywebstore.com/Salida-Backpack?seodebug=T
    [09:12:15.780] [    +0 ms ] Source URL: https://www.mywebstore.com/scs/shopping.ssp#/Salida-Backpack?seodebug=T
    [09:12:15.780] [    +0 ms ] Rewrite Path: /s.nl?sitepath=/scs/shopping.ssp
    [09:12:16.099] [  +319 ms ] Generated the frame page for the requested URL
    [09:12:22.215] [ +6116 ms ] Got a response from Prerender
    [09:12:22.216] [    +1 ms ] Memory usage:      30.523438MB
    [09:12:22.216] [    +0 ms ] CPU usage:         0.650000s
    [09:12:22.216] [    +0 ms ] Sub request total: 5.277000s
    ...
    --> 
    
                    

Troubleshooting Tips

Avoid Cached Responses

After a URL has been requested from the page generator, it will be cached. That means if you make a change and then request the same URL, you may get a cached version that will not reflect your changes. To work around this, you should include an additional URL parameter that will make the request unique without substantially changing the page content. To achieve this, you can use the preview parameter and give it an unused value each time you make a new request. For example:

view-source:www.mywebstore.com/Salida-Backpack?seodebug=T&preview=1234

The next time you request the page, you should change the number used, for example, by incrementing it by 1 from 1234 to 1235.

Use a Fresh Browsing Session

There are several scenarios when the SEO page generator will not run, and the most common is because you are using a browsing session where the current user is logged in or recognized. If the page generator does not run when requested, it will return a log describing the reason. For example:

              [04:05:20.169] [  +253 ms ] SEO page generator wasn't executed: bypassSeoGeneratorAfterSspForward: notGeneratable=false incorrectStatusOrContentForSeoGenerator=false bypassSeoGeneratorForRecognizedOrLoggedIn=true bypassSeoGeneratorSwitchEnabled=false, url=https://www.mywebstore.com/Salida-Backpack/?seodebug=T 

            

In this case, bypassSeoGeneratorForRecognizedOrLoggedIn is returning true, which means that the user is currently logged in or has logged in recently.

To avoid cases like these, it is recommended to use a fresh browsing session, such as those provided by your browser's incognito mode, or by using a different web browser than you normally use.

Investigate Console Logs for Errors

Because the page generator uses SSR for the JavaScript, there may be errors generated when it is parsed and executed. These will be returned in the debug log and may indicate a problem with your code. The most common problems relate to JavaScript that uses features from versions newer than ECMAScript 5.1, because they are not supported by the page generator and will cause errors. When this happens, you'll see a standard JavaScript error. For example:

              [04:53:02.240] [    +0 ms ] Logs generated by console.log():
               [    +0 ms ] SyntaxError: Invalid character: '`'
                                at anonymous (https://www.mywebstore.com/Salida-Backpack?seodebug=T:54)
               [   +74 ms ] SyntaxError: Unexpected token 'const'
                                at anonymous (https://www.mywebstore.com/scs/extensions/shopping_2.js?t=1654728269538:63) 

            

In this example, errors were thrown because the developer included template literals and constant variables in their code, which are not supported by ES5.1.

Important:

When investigating logs, the page generator will also return generic console logs and warnings, which may not be indicative of a problem.

Investigate Sub-Request Errors

The debug log will provide a breakdown of every additional resource that was requested when the page was loaded, including the status code that was returned and how long it took to load.

              [09:12:22.217] [    +1 ms ] Details of 15 sub requests:
    GET https://www.mywebstore.com/scs/public/shopping.environment.ssp?lang=es_AR&cur=&X-SC-Touchpoint=shopping&t=1714685769941 [status 200]
    Requested at 2024-08-06T16:12:16.216Z and responded by 2024-08-06T16:12:16.912Z (which took 696ms)
    GET https://www.mywebstore.com/scs/public/shopping.environment.shortcache.ssp?X-SC-Touchpoint=shopping&t=1714685769941 [status 200]
    Requested at 2024-08-06T16:12:16.217Z and responded by 2024-08-06T16:12:18.417Z (which took 2200ms)
    GET https://www.mywebstore.com/scs/languages/shopping_en_US.js?t=1714685769941 [status 200]
    Requested at 2024-08-06T16:12:16.217Z and responded by 2024-08-06T16:12:16.313Z (which took 96ms)
    ... 

            

You should check each status code for any error status codes, such as 404s and 500s.

Other Ways of Viewing Prerendered Content

SEO page generator content can be viewed without including outputs generated by the debug log. This may be preferable as it will show you the exact content that is generated and served to search engine crawlers.

  • Search Engine Tools – many search engines provide tools to website owners so that they can analyze their site, including looking at specific pages that they have indexed. One example of this is Google's URL Inspection Tool, which can provide you with the HTML it has received as well as a screenshot.

  • User Agent Spoofing – web browser and CLI developer tools let you request page content using a custom user agent string. If you set this user agent string to one that a search engine crawler uses, it should trigger the page generator to run.

Related Topics

General Notices