Installing the Widget with Google Tag Manager

Last updated: August 11, 2026

Use Google Tag Manager when your website team manages third-party scripts through GTM instead of editing the website code directly.

This article assumes you already copied the Docket script from the agent's Deploy tab.

Before You Start

  • You have access to the correct Google Tag Manager container.

  • You can create and publish GTM tags.

  • The agent's website domain has been reviewed in Docket.

  • You have copied the agent script from Deploy > Add widget to your domain or page.

Step 1: Create a New Tag

  1. Open Google Tag Manager.

  2. Select the container for the website where the widget should load.

  3. Go to Tags.

  4. Click New.

  5. Give the tag a clear name, such as Docket Marketing Agent Script.

Use a name that makes it easy for future admins to identify the tag.

Step 2: Choose Custom HTML

  1. Open Tag Configuration.

  2. Choose Custom HTML.

  3. Paste the Docket script copied from the Deploy tab.

Do not paste a script from another agent. Each agent has its own script.

Step 3: Configure Triggering

  1. Click Triggering.

  2. Choose where the tag should fire.

  3. For the core widget script, Docket's public setup guide recommends All Pages.

After the script loads through GTM, use Docket's Widget Behavior settings to control where the widget appears and whether it opens automatically, on selected pages, or on click.

Step 4: Save and Publish

  1. Save the tag.

  2. Submit or publish the GTM container changes according to your team's process.

  3. Wait for the published GTM container to be active on the website.

If your team uses GTM environments, make sure you publish to the environment used by the website you are testing.

Step 5: Validate the Website

Open the website and confirm:

  1. The GTM container is loading on the page.

  2. The Docket script is firing from GTM.

  3. The page is on a whitelisted domain.

  4. Widget Behavior matches the expected experience.

  5. The widget appears, or waits for the OnClick trigger if configured that way.

Troubleshooting

Issue

What to Check

Widget does not load

Confirm the GTM container is published and the Docket tag is active.

Tag fires on the wrong pages

Review the GTM trigger and Docket Widget Behaviour settings.

GTM preview works but production does not

Confirm the GTM container version was published to the correct environment.

Widget loads on staging but not production

Confirm the production domain is whitelisted and uses the published GTM container.

Verify the Google Tag Manager Installation

  1. Use Google Tag Manager Preview mode on the intended page.

  2. Confirm the Docket tag fires once for the expected trigger.

  3. Publish the container only after the preview succeeds.

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

  5. Confirm pages outside the trigger conditions do not load the widget.

Related Articles