Skip to Content
Tag ManagerContainers & InstallationInstall The Container Script

Install The Container Script

Use this guide to copy the generated Tag Manager script and place it on a website.

The install script loads the published version of a container. If the container has not been published yet, the script may be installed correctly but still have no live container behavior to run.

Preparation

Before you start

  • create or open the container
  • have a tracking domain available in the workspace
  • know which website template, page, or application shell should load the script
  • know whether allowed domains should be empty or limited to specific hostnames
  • know which published version should be served by the installed script

Install the script

Open the container

Open Tag Manager, then open the container you want to install.

Open Integrate

Choose Integrate.

Select the tracking domain that should serve the script.

The Integrate modal generates the install script from a selected tracking domain and allowed-domain settings.

Review allowed domains

Use Allowed domains when the container should only boot on specific hostnames.

Leave the field empty if the container is allowed to run anywhere the script is installed. Add one domain per line, or separate domains with commas, when you want protection.

Copy the generated script

Copy the generated script.

It will look like this:

<script async src="https://YOUR_TRACKING_DOMAIN.com/niq/tags/CONTAINER_ID.js"></script>

Place the script on the site

Place the script in the website template or application shell that should load the container. The Integrate modal describes the usual placement as inside <head>, or before the closing </body> tag when the template requires it.

Confirm the live request

Open the page where the script is installed and confirm the browser requests:

/niq/tags/CONTAINER_ID.js

The request is made against the selected tracking domain. When the container has a published version, the response is JavaScript and can be cached briefly by the browser or edge layer.

Validation

The script is installed when

  • the script is present on the intended page or template
  • the script URL uses the expected tracking domain
  • the container ID in the URL matches the Nitoriq container
  • allowed-domain settings do not block the live hostname
  • the browser requests /niq/tags/CONTAINER_ID.js
  • the container has a published version when live behavior should run

Was this page helpful?