Install the script tag
Add the Script Monitoring tag to your site. Copy your snippet from Setup step 3, pick a method and place the tag first in the head.
You install Script Monitoring by adding one script tag to the <head> of your site. The tag is the same for every page and every domain in a team, and the dashboard builds it for you: open Developers > Setup, go to step 3, Install, and copy the snippet for the method that fits your stack.
Which method should I use?#
Every method produces the same tag in the same place. There are three methods: HTML (with a Google Tag Manager option for testing), Coding agent and NPM. Pick HTML if you edit the HTML yourself, a coding agent to have it done for you, or NPM to add it in every build.
- HTMLPaste the tag first in the head of your pages, HTML shell or root layout. Works on every framework. Includes a Google Tag Manager option for testing.
- Coding agentOne prompt for Claude Code, Cursor or GitHub Copilot, with your script URL in it. It finds the right file and adds the tag on every page.
- NPMRun @scriptmonitoring/cli with npx after your build. It adds the tag to every HTML file the build writes, in CI too.
How do I find my snippet?#
- In the dashboard, open Developers > Setup. New accounts land here after sign-up.
- Answer step 1, Use case, and step 2, Site type. They are asked first because they change what the install step recommends, for example on a single-page app.
- Go to step 3, Install, and pick a method tile: HTML, Coding agent or NPM. For Google Tag Manager, pick HTML, then Google Tag Manager.
- Copy the snippet with its copy button. The step header shows your Script URL.
What goes into the snippet?#
Every snippet points at your team's script URL:
https://<teamID>.cdn.scriptmt.com/sm.js
<teamID> is your team's ID, a number such as 7508191425805750272, shown in the Team ID chip in the top bar of the dashboard. Example IDs in these docs, such as 14827391650423, are reserved for documentation: no real team ever gets one, and the script URL for them returns 403. Always use your own team ID. The dashboard fills it in, so a snippet copied from Setup is ready to paste. The NPM command takes the same ID as --team-id.
Every method produces the same tag (the plain one is on HTML), with two rules:
referrerpolicy="origin"sends your site's origin with the request, so the tag knows which domain it runs on. Keep it.- There is no
asyncand nodefer. The tag has to run before the scripts it watches.
Can I send the install steps to my developer?#
Yes. In step 3, Install, enter your developer's work email under Send to your developer and click Send steps. They get one email with your team's tag, the coding-agent prompt and the NPM command, already filled in with your team ID. If your site has a Content Security Policy that would block the tag, Send CSP changes to your developer emails them, for each domain that needs it, whether the policy is set in a response header or a <meta> tag and the exact policy line with *.cdn.scriptmt.com added to script-src and connect-src. Both need a work email address.
Where on the page does the tag go?#
At the top of the <head>, before any other script, on every page. Scripts that start before the tag are not seen. On a single-page app the rule is the same: the tag goes in the <head> of your HTML shell, before the app bundle, and the tag watches route changes instead of page loads.
Do my domains need to be in the dashboard?#
Yes. The tag reports from the domains in your team, so each domain it runs on must be listed under Security > Domains. Step 5, Verify, counts how many of them are reporting.
What is under Install > Advanced?#
Step 3 has an Advanced section with the team's install settings. Only Super admins and Admins of the team can change them.
| Setting | What it does |
|---|---|
| Script updates | When your sites get new versions of the script: Right away (the default) or After a delay, once a release has run elsewhere first. |
| Strip query strings | Removes query strings from page URLs before they are stored. Turn it on if your URLs carry secrets, such as password reset tokens or magic links. Script URLs are not affected, and URLs already stored are unchanged. |
| Custom request headers | Headers attached to the script's requests, so you can identify and filter them. |
Some teams also see Page scope, a list of URL patterns that limits which pages the script monitors. With no patterns, every page is monitored.
What comes after the install?#
Set your payment pages in step 4 if you need PCI DSS evidence, then verify the install in step 5. Content Security Policy reports are set up separately, with response headers on your server: see CSP reporting.
Frequently asked questions#
Is the snippet different for each domain?
No. The script is issued per team, and the team ID is part of its URL, so every domain in the team uses the same tag. CSP reporting is the one setting that is per domain.
Where do I find my team ID?
The dashboard fills it in for you in Setup step 3, which shows it as Script URL in the step header. It is also in the Team ID chip in the top bar, with a copy button. Always use that ID: the 14827391650423 in our docs, screenshots and videos is an example, not a real team.
Can I add async or defer to the tag?
No. Keep it a plain, synchronous tag at the top of the <head>. Scripts that run before it are not seen.
Which method should I use for a single-page app?
The tag goes in the <head> of your HTML shell (index.html) or, on Next.js, the root layout, before the app bundle. Use HTML, let a coding agent find the file, or add it in every build with NPM.
Do I need a different tag for staging?
No. The tag is per team. If staging is a separate domain, add it to the team so it reports, or put it in a separate team if you want its data kept apart (more than one team needs Pro).

