Add SiteLint to your site
To integrate your site with SiteLint Audits, you need to be able to update the HTML code of the website you want to audit.
To install the script
you have 3 options:
- Insert the code snippet between the
<head>
and</head>
HTML tags of your site. You can generate ready to use code snippet by going to Sites, More, View site settings and following the link Installation API Token. TheInstallation API Token
section will help you to generate the SiteLint code snippet. - WordPress user? Use our SiteLint WordPress plugin.
- To inject a script tag in Google Tag Manager, you can use Google Tag Manager Custom Tags. This feature allows you to inject the code snippet generated under the Installation API Token section. You can find more information on how to use Custom Tags in Google Tag Manager by visiting the official Google support page.
We recommend also adding the following code to speed up loading even further:
<link rel="preconnect" href="https://auditor.sitelint.com/" crossorigin>
Where to find your JavaScript snippet?
To set up the SiteLint code snippet, follow these steps:
- Log In to the Platform. Don’t have an account? Sign Up to create an account. The SiteLint code snippet will also be available on the Sign Up Welcome page.
- Go to Sites, then select More, View site settings.
- Follow the link Installation API Token. This should lead you to the section where you’ll be able to create the code snippet for your site.
- Copy the entire content of the text box to the clipboard (or use the Copy script to clipboard button for that purpose).
- Insert the code snippet between the
<head>
and</head>
HTML tags of your site.
How do I verify if the audits work?
Once the code snippet is placed on your site you should start receiving audit results, and they should be available under Sites section. The reports will be visible typically within 24-48 hours.
See also How to check if SiteLint is working for troubleshooting potential issues.
Configuration options for the code snippet
The SiteLint code snippet with audits is also configurable under Sites, More, View site settings and following the link Installation API Token.
There are the following options:
- Start loading on the event – you can choose on which event the code should start loading:
onload
orDOMContentLoaded
. Default:DOMContentLoaded
- Loading delay in ms – for any reason, you may want to delay the loading code with a specific delay time. Default: no delay.
- Include hidden elements – this option allows you to include or exclude invisible elements while auditing the site. Default:
true
. - Remove sensitive data – this option allows you to remove all texts as well as all form controls value. Default:
false
.
Technical details
The SiteLint code snippet is lazy-loaded and does not impact the initial page loading performance. It uses the defer
attribute, but you can change that to async
when you need.
How does the async
and defer
attribute works?
This is all summarized in the schematic diagram below:
Source: WHATWG