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
Log in to app.docketai.com.
Click Marketing Agent Configuration in the left sidebar.
Select the agent you want to deploy.
Open the Deploy tab.
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:
Create a new tag in Google Tag Manager.
Choose Custom HTML as the tag type.
Paste the Docket script.
Choose the pages where the tag should fire.
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:
Open the website template or layout used by the pages where the widget should load.
Paste the Docket script near the end of the page body.
Publish the website change.
Test on the final website URL.
Step 4: Validate the Deployment
After the script is installed:
Open the website in a clean browser session.
Confirm the page matches a whitelisted domain.
Confirm Widget Behavior is configured for the page.
Check that the widget loads or waits for the expected OnClick trigger.
If the widget does not appear, review the browser Console and the related troubleshooting article.
Verify the Website Installation
Open the deployed page in a private browser window.
Confirm the Marketing Agent widget appears only on an allowed domain and page.
Open the widget and complete a short text interaction.
Confirm the page loads the Docket script once and the browser console shows no blocked-script or configuration error.
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. |