Add the Monsido Script

How to add the Monsido script

Updated over a week ago

This article gives instructions on how to add the Monsido script to a website.

Article Navigation


Introduction

Only Admin Users can add the Monsido script.

Keep in mind that the script is unique for each domain. Do not copy/paste from one 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.

Note: 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 chapter:


Script Setup Guide

This section gives information about the steps needed to set up the Monsido Script.

Note: Only Admin Users can do these steps.

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

    Note: The Admin Settings button is only available to site admins.

    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 to OFF or ON.

      For more information, see the User Guide chapters:

    • Enable Cookieless Tracking: Toggle the switch to OFF or ON.
      For more information, see the User Guide chapter:
      Cookieless Tracking.

    • Enable Document Tracking: Toggle the switch to OFF or ON. Monsido 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 chapter:

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

      For more information, see the User Guide chapter:

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

      For more information, see the User Guide chapter:

    • 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 Monsido 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 Monsido for Developers 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 Monsido 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 Monsido 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 chapters:


  • 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 Monsido for Developers 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 Monsido 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 Monsido under special circumstances.

CMS

This section gives information on how to install the Monsido 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 Monsido 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 Monsido 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 Monsido script on a website that deploys with a CMS, see the Monsido for Developers article Intro to CMS.

For more information, see the User Guide chapter:


Dynamic

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

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

Add the Monsido 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 Monsido script on a static website.

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

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

Note: 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, see the User Guide chapter:

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


Cookieless Tracking

The Monsido Statistics module normally applies a cookie to the browser of the visitor. It is possible to remove this so that Monsido 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, Monsido relies 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: Monsido Statistics must be enabled. For more information, see the User Guide article:
Statistics.

For full instructions, see the User Guide chapter:


Additional Resources

For more information, see also:

For definitions and explanations of acronyms and abbreviations used in the Monsido User Guide, see:

For further assistance, contact the Monsido support team at support@monsido.com or use the Monsido chat and help features inside the application.

Image of the toolbar with the Help Center buttons highlighted.

Did this answer your question?