Adding a Third-Party Script for Analytics Tracking

You can integrate third party services with your SuiteCommerce Advanced website. Note, however, that the SEO page generator does not evaluate third party scripts by default. You can specify ns-server-execute=’T’ to make sure that the script runs.

Scripts stored in the NetSuite file cabinet are evaluated automatically in the SEO page generator. Every JavaScript file referenced by a URL with a NetSuite domain, such as system.netsuite.com, or by your custom website domain, runs automatically in the SEO page generator. To avoid duplicate execution of tracking scripts, such as GoogleAnalytics or visual-only JavaScripts, third party scripts are not automatically evaluated by the SEO page generator. This prevents the script from running both in the browser that initiated the request and in the SEO page generator.

If you are calling a script from a different location (such as a third party website), the script does not run automatically. Therefore, you need to specify ns-server-execute=’T’ to ensure that the script runs as expected. See the following code sample:

                 <script type='text/javascript' ns-server-execute='T' src='http://thirdparty.com/script.js'> 

        
Important:

The third-party scripts run in a Single Page Application (SPA) website, and not all third-party scripts are set up for SPAs. Consequently, the scripts may not work, or you may need to perform a more complex integration than adding a script tag as described above.

If you do not want to execute a script in the SEO page generator, and the script is stored in the file cabinet, specify ns- serverexecute= ‘F’ to ensure that the SEO page generator does not evaluate your script.

If the <script> tag is dynamically injected into the DOM by a JavaScript code, the script will run in SEO page generator regardless of the domain and ns- server-execute=’F’ attribute. However, you can wrap the script in a statement similar to the following to indicate that it is not for the SEO page generator:

          if(!SC.isPageGenerator()){
// Insert non-page generator content here } 

        

Related Topics

SEO Page Generator
SEO and Redirects
SEO and Robots.txt
Sitemap Generator
Troubleshooting Your Website

General Notices