Adding the Marketing Agent Script to Your Website

Last updated: September 29, 2026

You can show the Docket widget on your website by copying one script from your agent and adding it to your pages. Choose the widget when you want the agent to appear on the pages people already visit, and choose a standalone page instead when you want one link to share. The script is unique to the agent you copy it from, so copy it fresh rather than reusing another agent's snippet.

What do I need before I add the script?

You need an agent in Docket, the domain you want the widget on, and someone who can edit that website.

  • The agent has been created in Docket.

  • The domain where the widget should appear is listed under Whitelist Domains on the Widget tab. The widget only works on whitelisted domains.

  • You or your web admin can edit the website, CMS, or tag manager.

  • You know whether your team deploys website scripts through Google Tag Manager or directly in the site HTML.

Where do I find the widget script in Docket?

The script is on the agent's Deploy tab, in the Add widget to your domain or page section.

  1. Log in to Docket at app.docketai.com.

  2. Click Marketing Agent Configuration in the left sidebar.

  3. Select the agent you want to deploy.

  4. Open the Deploy tab.

  5. Find Add widget to your domain or page. It is expanded by default and shows the generated script.

  6. Click Copy Script, or click Email to Web Admin to send it to the person who edits the site.

The Deployment page in Docket, showing the Add widget to your domain or page section with the generated script below it. Callout 1 marks the Copy Script button and callout 2 marks the Email to Web Admin button.

Action

Use It When

Copy Script

You are installing the script yourself.

Email to Web Admin

Someone else manages the website implementation. See Sending Deployment Instructions to a Web Admin.

Do not edit the generated script unless Docket support or your implementation owner specifically instructs you to.

How do I add the script to my website?

Paste the copied script into every page where the widget should load, either through your tag manager or directly in the site template.

Google Tag Manager

Use this path if your website team manages third-party scripts through GTM.

At a high level:

  1. Create a new tag in Google Tag Manager.

  2. Choose Custom HTML as the tag type.

  3. Paste the Docket script.

  4. Choose the pages where the tag should fire.

  5. Save and publish the GTM changes.

For the core widget script, Docket's public setup guide recommends firing the tag on all pages, then using Docket's Widget Behaviour settings to control where the widget appears. For the full walkthrough, see Installing the Widget with Google Tag Manager.

Direct Website HTML

Use this path if your website team adds scripts directly to the website template or CMS.

At a high level:

  1. Open the website template or layout used by the pages where the widget should load.

  2. Paste the Docket script near the end of the page body.

  3. Publish the website change.

  4. Test on the final website URL.

For the full walkthrough, see Installing the Widget Directly in Website HTML.

How do I check that the script is installed?

Docket reports this for you: each domain row under Whitelist Domains on the Widget tab shows whether Docket has detected the script on that domain. Check there before you go digging through page source.

  1. Open the agent's Widget tab and find Whitelist Domains.

  2. Read the detection state on the row for your domain.

  3. If the row reads "We couldn't find the DocketAI Script on your domain", Docket is not seeing the script there.

  4. Publish your website change, then use the rescan control next to the Add Domain field.

  5. Open the deployed page in a private browser window.

  6. Confirm the widget appears on the whitelisted domain and page.

  7. Open the widget and complete a short text interaction.

  8. Confirm the page loads the Docket script once, with no blocked-script or configuration error in the browser console.

  9. Open a page where the widget should not appear and confirm it stays hidden.

One setting changes what you should expect to see. If Show Widget on is set to On Click (Function Call) for that domain, the widget will not open by itself. Your site has to call a JavaScript function to open it, so the install can be correct and the page can still look empty. See Setting up OnClick Trigger for the Widget.

Which Docket hosts do I need to allowlist?

Allow docketai.com and its subdomains, plus d33t2173eag6fx.cloudfront.net, in every place your organization can block an external script. A blocked script is a common reason a correct install shows nothing, and it has held up customer go-lives.

Host

Why it is needed

docketai.com and its subdomains

Covers cdn.docketai.com, app.docketai.com, and aiseller.app.docketai.com.

d33t2173eag6fx.cloudfront.net

Serves the widget script for older agents.

Which of the two hosts your agent uses depends on when the agent was created, and both are live today. Read the host from your own agent's script rather than copying one from another team's ticket. Open the Deploy tab, look at the loader URL inside Add widget to your domain or page, and allow the host you see there.

Check all of these places, not just the first one that blocks:

  • The script rules in your consent manager.

  • script-src in your Content Security Policy, so the browser can load the script.

  • connect-src in your Content Security Policy, so the widget can call back to Docket. Both directives are needed.

  • Any firewall, proxy, DNS filter, or WAF rule.

Allowlisting an external script is not the same as exempting one of your own URLs. In one blocked go-live, the security team had been editing a Wordfence WAF Allowlisted URLs parameter table. That screen exempts a parameter on the customer's own URLs and cannot allow an external script.

Treat the hosts above as the current list rather than a permanent one. Re-read the script on the Deploy tab when you set up a new agent, and check it again if a widget that used to load stops loading.

Why isn't the widget showing up after I installed the script?

The usual causes are a domain that is not whitelisted, a widget set to open only on click, and a script blocked before it loads.

Problem

What to check

Widget does not appear

Confirm the exact script from the agent's Deploy tab is present in the rendered page source, and that the domain is whitelisted.

Console shows the script was blocked

Work through the allowlisting section above: consent manager, script-src and connect-src, firewall, proxy, DNS, and WAF.

Script loads but the widget never opens

Check Show Widget on for that domain. On Click (Function Call) waits for a JavaScript call from your site.

Widget loads twice

Remove duplicate direct, theme, or tag-manager installations.

Wrong agent loads

Replace copied code with the script from the intended agent.

Widget works on one page only

Review the whitelisted domains and the page targeting on the Widget tab.

Page returns HTTP 403

Check whether the domain is whitelisted, then check IP Access Rules on the Deploy tab. Both return 403.

Frequently asked questions

Do I need a different script for each agent?

Yes. The script carries that agent's own agent_id, so a snippet copied from another agent loads the other agent. Copy the script from the Deploy tab of the agent you want on the page.

Why does my script use a different host than a colleague's script?

The CDN host depends on when the agent was created, and both hosts are live while Docket moves between them. Allow both hosts, or read the host from each agent's own script before you file an allowlist request.

What does "We couldn't find the DocketAI Script on your domain" mean?

Docket has not detected the widget script on that domain. Publish the page with the script, then use the rescan control next to the Add Domain field on the Widget tab. If the message stays, check that nothing on your side is blocking the script.

Can I use IP Access Rules to allow our office or the Docket script?

No. Every rule in IP Access Rules restricts access, and there is no allow option, so entering your own office IP would block your office. Allowlisting for the script belongs in your consent manager, Content Security Policy, and network rules. See Setting Up IP Access Rules for Agent Security.

Why does the page return a 403?

A visitor blocked by an IP access rule gets an HTTP 403, and a domain that is not whitelisted also returns 403. Check Whitelist Domains on the Widget tab first, then IP Access Rules on the Deploy tab.

Do I need this script for a standalone page?

No. A standalone page is shared as a link, or embedded with the Embedding Code from the Deploy tab. The script on this page is for showing the widget on your own website.

Related articles