---
title: "How to add the Web Governance script"
date: "2025-01-08T20:44:31+00:00"
summary: "Learn how to add the Acquia Web Governance script to your website for enhanced tracking and analytics capabilities."
image:
type: "page"
url: "/web-governance/how-add-web-governance-script"
id: "81d7d1e3-cac8-4633-a921-8b882958c9b6"
---

Table of contents will be added

**Introduction**
----------------

The following modules and features require the script to be added to your website:

*   Statistics
*   Heatmaps
*   PageAssist
*   Consent Manager
*   PageCorrect

This document provides instructions for Admin users on how to add the script to a website.

Notes

*   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 visit ​[Path constraints and link exclusions](/node/58571).
*   If your website uses Google Tag Manager, refer to the advanced section for specific instructions on this type of installation:  
    For more information, visit ​[Google Tag Manager deployment](/node/58476).

Script setup guide
------------------

This section provides instructions for Admin users on how to configure and add the script.

1.  Navigate to the _Domain Overvie_w page.
2.  Click **Action** on the same row as the domain and select **Script Setup Guide** from the expanded list of options.
    
    The system opens the _Set up your domain_ page.
    
    ![The Set Up Your Domain page. The fields are described in the document text.](https://acquia.widen.net/content/2c9b9182-33ee-42bc-8a19-4590c571b6aa/web/WebGov_ScriptSetupGuide-SetUpYourDomainPage.png)
    
3.  Configure the options for the features included in your company’s plan.
    *   **Enable Statistics**: Toggle the switch **ON**.
        
        For more information, visit [Statistics](/node/60241).
        
    *   **Enable Cookieless Tracking**: Toggle the switch **ON**.  
        For more information, visit ​[Cookieless tracking setup](/node/58866).
    *   **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 add-on.   
        For more information, visit:
        *   [PageAssist setup](/node/81741 "PageAssist setup")
        *   [PageAssist advanced configuration](/node/58946)
    *   **PageCorrect**: Turn the switch **ON** to enable this add-on.
        
        For more information, visit [PageCorrect setup](/node/60041).
        
    *   **Heatmaps**: Turn the switch **ON** to enable this feature.
        
        For more information, visit [Heatmaps setup](/node/58936).
        
    *   **Consent Manager**: Turn the switch **ON** to enable this feature.
        
        For more information, visit [Consent manager setup](/node/81751).
        
4.  Inside the script section, click **Copy Script** (the icon of two papers) to copy the script.
5.  ![The location of the Copy Script button, in the Script section of the page.](https://acquia.widen.net/content/b7531398-a158-461e-9f6e-1b9a2571bbc2/web/Mon_AdminSettings-DomainSettings-CopyScriptButton.png)
    
    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.
    
    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 advanced information and instructions, visit [Attributes](/node/57876).
    
6.  In the HTML editor for your site, 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.  Do the following steps to verify:
    1.  Navigate to the _Domain Overview_ page.
    2.  Verify that the words "Script Installed" appear on the same row as the domain.
        
        ![The Script Installed indicator, on the same row as a domain on the Domain Overview page.](https://acquia.widen.net/content/02f27bcc-514f-4998-a5ac-f1769d05c6f7/web/WebGov_AdminSettings-ScriptInstalled.png)
        

### 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, that guide may also be used to install the script. This section provides instructions on how to install the script on a website that deploys with a CMS.

The script highlights errors highlighted on the page where they occur and displays them on the various pages of Web Governance. If you have access to the Analytics module, the system begins to display statistics 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, visit the [CMS integration](/node/57881) collection.

For more information, visit [Configure the scan](/node/58536).

### **Dynamic** 

This section provides 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 provides 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 that end 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, visit [Set up and Install Tag Manager](https://support.google.com/tagmanager/answer/6103696?hl=en&ref_topic=3441530).
*   For more information and full instructions, visit [Google Tag Manager deployment](https://docs.acquia.com/acquia-optimize/admin/setup/script/gtm-deployment).

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, Web Governance 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 the 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.

For more information, visit [Cookieless tracking setup](/node/58866).

Notes

The Statistics feature must be enabled.

For more information, visit [Statistics setup](/node/60241).