Skip to main content
Add the Script

How to add the script

Updated this week

Article Navigation


Introduction

This article gives information on how to add the script to your website.

Notes:

  • Only Admin users can create and add the script.

  • The script is unique for each domain. Do not copy and paste the script from one domain to another. Website URLs that end in .com and .eu, for example, are considered different domains and they need different scripts. Configure the script separately for each domain.

  • If you plan to do the scan on a path-based domain, you need to set up path constraints because the crawler will crawl everything it can find on the domain. For more information on how to set up path constraints, contact your customer service manager or see the user guide article:
    Path Constraints and Link Exclusions.

  • If your website uses Google Tag Manager, refer to the advanced section for specific instructions on this type of installation:
    Google Tag Manager section of this document.
    For more information, see the user guide article:
    Google Tag Manager-Monsido Deployment.


Script Setup Guide

This section gives information about the steps for Admin users to set up the script.

  1. Click Admin Settings (gear icon) on the top menu bar of any page in the platform. The Domain Settings page opens.

    The location of the Admin Settings button on the top menu bar, in line with the Monsido Home button.
  2. Click Action on the same row as the domain to scan.

    The location of the Action button on the same row as a domain, in the Actions column.
  3. Select Script Setup Guide in the drop-down list. The Domain Setup page opens.

    The location of Script Setup Guide, in the Action drop-down menu on the same row as a domain.
  4. Configure the options for the features included in your company’s plan.

    • Enable Statistics: Toggle the switch ON.

      For more information, see the user guide articles:

    • Enable Cookieless Tracking: Toggle the switch ON.
      For more information, see the user guide article:
      Cookieless Tracking.

    • Enable Document Tracking: Toggle the switch ON. The scan automatically detects a download as a click on a link that ends with one of the following file extensions:

      • Document Class: Enter text to identify the links associated with class names to include.

      • Document Ignore Class: Enter text to identify links associated with class names to exclude.

      • Document Extension: Enter the document extension text, for example, PDF or doc (no preceding period is needed) to identify the document extension to include. Click + to add a new row for each document extension.

        Note: The extensions are case-sensitive.

    • PageAssist: Turn the switch ON to enable this feature.

      For more information, see the user guide article:

    • PageCorrect: Turn the switch ON to enable this feature.

      For more information, see the user guide article:

    • Heatmaps: Turn the switch ON to enable this feature.

      For more information, see the user guide article:

    • Monsido Consent Manager: Turn the switch ON to enable this feature.

      For more information, see the user guide articles:

  5. Inside the script section, click Copy Script (icon of two papers) to copy the script.

    Image showing the Copy Script button within the script field.

    Important! The script is unique for each domain. It will not work to copy/paste from one to another. Websites ending in .com and .eu, for example, are considered different domains and it does not work to copy/paste the script. The script needs to be configured separately for each domain.

    Note: With Consent Manager, be sure to add HTML attributes.

    HTML attributes must be added to content elements on your website if you only want them to load once a cookie consent choice has been provided by the visitor. For example, if you are using Google Analytics on your website and only want the script to load once a visitor has accepted Statistics cookies, you will need to mark up the Google Analytics script with an HTML attribute.

    For more information and instructions, see the article:

  6. In the HTML editor, paste the script into the HEAD tag or place it before the </body> tag on every page.

    Note: If Consent Manager is activated, the script must be in the HEAD tag in order to catch the cookies.

  7. Save and commit the changes as needed.

  8. Return to the platform and refresh the page.

  9. Open the Domain Settings page (gear icon). The column Script shows the message Script Installed.

    Image showing the Script Installed indicator.
  10. Repeat for each domain.

Place the script on the pages to track - normally every page of the website.

In the CMS (or the website template files), add the copied code to the HEAD tag or place it before the </body> tag.

For PageAssist, PageCorrect, Heatmaps, and Consent Manager, toggle those options ON (if available) and configure them, and then copy the script.

For more information, see the user guide articles:

  • Consent Manager.
    Notes:

    • If Consent Manager is activated, the script must be in the HEAD tag in order to catch the cookies.

    • HTML attributes must be added to content elements on your website if you only want them to load once a consent choice has been provided by the visitor. For example, if you are using Google Analytics on your website and only want the script to load once a visitor has accepted Statistics cookies, you will need to mark up the Google Analytics script with an HTML attribute.

      See the article:

    For more information, see the user guide article:

Note: The script is unique for each domain. It will not work to copy/paste from one domain to another. Websites that end in .com and .eu, for example, are considered different domains and it does not work to copy/paste the script. The script needs to be configured separately for each domain.

Tip: It is also possible to insert the code just before or after any Google Analytics™ script or other utility scripts. After installation, browse the sites and make sure that the script loads correctly.


Advanced instructions

This section gives advanced instructions on how to set up the script under special circumstances.

CMS

This section gives information on how to install the script on a website that deploys with a CMS.

Most modern CMS systems provide an easy way to add custom scripts to web pages. Include the script in the page header, so that the snippet appears before the closing </head> tag on every web page of the site that needs to be tracked. Refer to the CMS manual or ask for help from the CMS vendor for instructions on how to install custom scripts on all pages. If there is a guide for the CMS that describes how to install the Google Analytics™ script, this guide may also be used to install the script.

When the script is installed, errors are highlighted on the page where they occur. If you have access to the Analytics module, statistics are shown immediately.

Note: If a CMS is selected during the scan configuration and a domain with the same selected CMS exists on the account, the domain will automatically have any source code exclusions applied to it.

For advanced instructions for developers on how to install the script on a website that deploys with a CMS, see the article:

For more information, see the user guide article:


Dynamic

This section gives instructions on how to install the script on a dynamic website.

A dynamic website generates HTML with a programming language such as Python, Ruby, PHP, or similar.

Add the script to the source code on every webpage that needs to be tracked. Alternatively, use a common include or template to push the script dynamically onto every page.

Paste the script into its include file, then include it in the page header. The snippet appears before the closing </head> tag on every page of the site that needs to be tracked.


Static

This section gives instructions on how to install the script on a static website.

Copy and paste the script so that the snippet appears before the closing </head> tag on every page of the site that needs to be tracked.

Notes:

  • If Consent Manager is activated, the script must be in the HEAD tag for it to be able to catch the cookies.

  • The script is unique for each domain. Do not copy/paste the script from one to another. Websites ending in .com and .eu, for example, are considered different domains. Configure the script separately for each domain.


Google Tag Manager

This section provides a link to the full instructions on how to add custom scripts to Google Tag Manager.

For instructions from Google on how to install Tag Manager, see:

For more information and full instructions, see the user guide article:

Important! Remember to Publish from within Tag Manager after you make any changes.


Cookieless Tracking

The Statistics feature normally applies a cookie to the browser that the visitor uses. It is possible to remove this so that we can track the same data from visitors who refuse statistics cookies on the cookie banner. Cookieless tracking requires a separate line of script in the Statistics section.

To gather the same data without a cookie, we rely on other pieces of information such as operating system, browser, browser plugins, user IP address, and browser language to assign a unique ID to each visitor in our systems. The unique ID is only valid for 24 hours and visitor IP addresses are fully anonymized until they are deleted. This makes the solution privacy-friendly and prohibits fingerprinting.

Note: The Statistics feature must be enabled.

For more information, see the user guide articles:


Additional Resources

For more information, see also:

For definitions and explanations of acronyms and abbreviations, see:

For further assistance, contact the support team or use the chat and help features inside the application on the main menu toolbar:

  • Live Support Chat (chat bubble icon).

  • Knowledge Base (Question mark icon).

  • Profile (user initials) expand the menu for the option to set up an online training session.

The location of the help center buttons on the main toolbar in line with the logo.
Did this answer your question?