Installing the Widget Directly in Website HTML

Last updated: August 11, 2026

Use direct HTML installation when your website team adds scripts directly to your website template, CMS theme, or page layout.

If your team manages third-party scripts in Google Tag Manager, use the GTM installation article instead.

Before You Start

  • You can edit the website template or page layout.

  • You have copied the Docket script from the agent's Deploy tab.

  • The target domain has been reviewed in Whitelist Domains.

  • You know which pages should load the widget.

Step 1: Copy the Agent Script

  1. Log in to app.docketai.com.

  2. Click Marketing Agent Configuration in the left sidebar.

  3. Select the agent.

  4. Open the Deploy tab.

  5. In Add widget to your domain or page, click Copy Script.

The script is tied to the selected agent. Do not copy a script from a different agent.

Step 2: Open the Website Template

Open the website template, CMS theme, or layout file used by the pages where the widget should be available.

Common places include:

  • The global website layout.

  • A shared footer or body template.

  • A CMS custom-code area.

  • The page template used by your campaign or product pages.

Step 3: Paste the Script Near the End of the Body

Paste the Docket script near the end of the page body, before the closing </body> tag.

This lets the page content load while still making the widget available to visitors.

If your CMS has separate fields for header and body/footer scripts, use the body or footer script location unless your implementation owner instructs otherwise.

Step 4: Publish the Website Change

Publish the website update using your normal deployment process.

If your site uses a staging environment, test there first, then repeat the deployment for production.

Step 5: Validate on the Live Page

Open the final page URL and check:

  1. The page is on a whitelisted domain.

  2. The script is present in the rendered page.

  3. Widget Behaviour is configured for that page.

  4. The widget loads, or waits for the expected OnClick trigger.

  5. The browser Console does not show script loading errors.

Troubleshooting

Issue

What to Check

Widget does not appear

Confirm the script was published to the live page and the domain is whitelisted.

Widget appears on staging but not production

Confirm the production site also has the script and domain whitelist.

Script is present but widget does not load

Check Widget Behaviour, Work Hours, and browser Console errors.

Wrong agent appears

Confirm the script was copied from the correct agent's Deploy tab.

Verify the Direct Installation

  1. Deploy the updated HTML to a test environment.

  2. Confirm the copied Docket script appears once in the rendered page source.

  3. Open the page in a private browser window and complete a short widget interaction.

  4. Check the browser console for blocked resources or initialization errors.

  5. Repeat on a page that should not display the widget.

Related Articles