Adding the Marketing Agent Script to Your Website

Last updated: August 11, 2026

Add the Marketing Agent script when you want the Docket widget to load on your website.

The script is unique to the selected agent. Copy it from Docket instead of reusing a snippet from another agent.

Before You Start

  • The agent has been created in Docket.

  • The domain where the widget should appear has been reviewed in Whitelist 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.

Step 1: Open the Deploy Tab

  1. Log in to 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.

This section contains the script for the selected agent.

Step 2: Copy or Send the Script

Use one of the available actions:

Action

Use It When

Copy Script

You are installing the script yourself.

Email to Web Admin

Someone else manages the website implementation.

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

Step 3: Choose an Installation Method

Docket supports two common installation paths.

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.

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.

Step 4: Validate the Deployment

After the script is installed:

  1. Open the website in a clean browser session.

  2. Confirm the page matches a whitelisted domain.

  3. Confirm Widget Behavior is configured for the page.

  4. Check that the widget loads or waits for the expected OnClick trigger.

  5. If the widget does not appear, review the browser Console and the related troubleshooting article.

Verify the Website Installation

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

  2. Confirm the Marketing Agent widget appears only on an allowed domain and page.

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

  4. Confirm the page loads the Docket script once and the browser console shows no blocked-script or configuration error.

  5. Repeat on a page where the widget should not appear.

Troubleshooting the Website Script

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.

Script is blocked

Review Content Security Policy, tag-manager consent rules, and browser console errors.

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 allowed domains and page-targeting behavior in the Widget tab.

Related Articles