Skip to main content

Adding Siteimprove Analytics JavaScript to your website

Sean Needham avatar


In order to use Analytics (or Priority) on your website, you will need to add the Siteimprove Analytics JavaScript code. The code will be sent once you subscribe or request a trial for Analytics. The code can also be found in the platform when you select a site using the Analytics site selector, that has an Analytics subscription but does not have the code.

This article covers: 

Reach out to Siteimprove technical support if you have any questions regarding the code.

Getting your version of the script

You can find your version of the Siteimprove Analytics script from the left-had menu.

Go to Analytics > Analytics Settings > Tracking > Analytics Script.

Analytics_Script_in_platform

Example of Siteimprove Analytics JavaScript code:

Note: The 'XXXXX' in the code below represents a numeric code that is specific to your account so Do Not use this exact code below.

<script type="text/javascript">
/*<![CDATA[*/
(function() {
var sz = document.createElement('script'); sz.type = 'text/javascript'; sz.async = true;
sz.src = '//siteimproveanalytics.com/js/siteanalyze_XXXXX.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(sz, s);
})();
/*]]>*/
</script>

You can use this same Analytics JavaScript code no matter how many websites you are tracking with Siteimprove Analytics. The code will need to be added to all pages that you want to track.

The Siteimprove Analytics JavaScript is asynchronous which means it will not affect your website’s performance, can work seamlessly with other JavaScript, and is not required to be placed in a specific location on your website.

Note: We recommend that the JavaScript is always added at the bottom of the website in a footer or similar, just before the closing HTML body tag. Also, JavaScript can be blocked by a content security policy (CSP) configured to prevent unwanted cross-site-scripting. If you use CSP, please configure it to allow the Siteimprove script.

It is likely you will need to take one of the following approaches in order to get the Siteimprove Analytics JavaScript on your site.

Adding the code manually

If you are able to access the HTML of your website or your Content Management System has a field specifically for adding tracking code you will be able add the Siteimprove Analytics code to your site.

It is recommended that you place the Siteimprove Analytics JavaScript on every page of your website just above the closing body-tag which looks like this </body>

Siteimprove Analytics JavaScript example

Add the code in your CMS

In this instance, you will want to find the file for the footer of your website (in WordPress that is footer.php for example) and place the code above the closing body-tag, </body>

Have your website/CMS provider add it

In some cases, you will not have access to include files like your footer. If this is your situation you will need to contact your content management system provider and request that they insert the JavaScript on your behalf. The JavaScript should still be inserted just above the closing body tag, </body>.

There can be a cost associated with this so be sure to inquire about fees with your website provider.

Add code through a Tag Manager

If you utilize a tag management service like Google Tag Manager you can still utilize Siteimprove Analytics by adding the Analytics JavaScript through the tag manager. Be sure to follow the instructions for your tag management tool of choice to install it correctly.

Important: Please ensure that the Siteimprove Analytics script is configured to load asynchronous in your Tag Manager.

If we use Google Tag Manager as an example you will want to paste the Tag Manager script on your site first. Once that is done you need to log in to the Tag Manager account and create a new Custom HTML Tag.

Google Tag Manager interface

Next, add the JavaScript (1).

In 'Advanced Settings' change 'Tag firing options' to 'Unlimited' (2).

Finally, chose triggering that includes firing script on DOM/page load, like: 'DOM Ready', 'Page View' or 'Window Loaded' (3).

Advanced Settings Google Tag Manager

Siteimprove Academy Analytics courses

The Siteimprove Academy offers scalable learning programs, interactive course content, and actionable outcomes for you and your team. Take advantage of our online courses to get the most out of our products.

Reach out to Siteimprove technical support if you have any questions.

Was this article helpful?

24 out of 32 found this helpful