Web basics

Remove a Live Chat Agent: Three Jobs, Not One

Removing a live chat widget from a website is not one job, it is three, and most people only do the first. The visible chat bubble stops appearing as soon as you remove the script tag, but the loader has already written cookies and local storage on the visitor's device, and your account still holds every transcript, every operator seat and the data you are responsible for. Each layer has its own removal step, and skipping one leaves evidence behind that a privacy regulator, a security auditor or a future visitor can find.

This page walks through all three layers in order, with the exact checks you can run today to confirm the widget is really gone. It also covers what happens to conversations already in flight when you pull the plug, because that is the part nobody thinks about until a customer is mid-sentence.

The three layers of "removing" a chat widget

Every live chat product on a website is the same shape from the outside: a script tag in your template, a small loader that runs in the visitor's browser, and a vendor account on a server somewhere that holds the conversations. Each layer is owned by a different team, each stores different data, and each has to be dealt with separately. Treating "removing the chat" as a single ticket is the mistake this article is built to prevent.

Layer What lives in it Who controls it
The template The script tag, the loader URL, any CSS or image assets in the head or footer of your site Your developers, or whoever edits your theme
The visitor's browser Cookies set by the widget, local storage entries, the service worker if one was registered, and any cached HTML for the chat panel The visitor, with your code having planted the data
The vendor account Transcripts, contacts, operator accounts, billing, integrations with your CRM or helpdesk, API keys The vendor, under contract terms you signed

These layers do not communicate with each other. Removing the script tag does not wipe the visitor's cookies. Deleting the vendor account does not remove the script from your template. You have to address each one explicitly.

The mechanism
Removing a chat widget is three jobs; what stays behind at each layer
Layer 1 · Script tag in your template
What most teams do, and stop here
Delete the line, redeploy, the bubble stops appearing. This removes the visible widget, not the data it left behind.
Visibility on the page
0 of 3 jobs
Layer 2 · Cookies and local storage on the visitor
Visible only with DevTools, lives independently of the script tag
Each entry the loader writes is a separate leftover. Bars below use one shared scale of 12 months so the durations are comparable.
Session cookie
expires with tab
Persistent cookie
~12 months on device
Local storage entry
until the visitor clears it
Scale: 0 to 12 months. Wider bar means it sticks around longer.
Layer 3 · The account on the server
Never on the page, never removed by deleting the script
Transcripts, operator seats and the active subscription are server-side. Auto-delete and retention windows are configured per plan, and the contract tier is the only one set by a signed order form with a negotiated message allowance.
Past transcripts
kept until auto-delete
Operator seats
kept until you cancel
Contract tier allowance
negotiated, not self-serve
Worked example using Asyntai's own plan figures
A site on the Standard plan, with the widget removed this month, leaves these numbers in play.
Standard plan, monthly
$139 per month
Standard plan, annual
$139 x 12 months
Message allowance included
15,000 messages
Pro tier allowance, for context
50,000 messages
Deleting the script tag clears Layer 1, which is only one of three jobs. Cookies and local storage on every prior visitor persist for up to 12 months, and the server-side account keeps every transcript and seat until you take action there. Run the checks in order before you tell anyone the widget is gone.

Layer one: the script tag in your template

This is the only part most teams actually do, because it is the only part with a visible result. The chat bubble disappears from the page within a few seconds of deploying the change, and people stop testing. Done is not the same as removed, however, and the gap between them is what this section is about.

Where the tag usually lives

Live chat vendors ship their loaders as a small JavaScript snippet, almost always a <script> tag with a vendor-specific ID. The tag goes in one of four places, and the place decides how easy removal is.

  1. Direct in the theme. Hand-edited into header.liquid, footer.php, the Code Injection panel of a hosted site builder, or whatever your CMS calls its global template region. This is the case you can fix in five minutes, and also the case that tends to get re-added by a plugin or snippet manager.
  2. Inside a tag manager. Google Tag Manager, Tealium, Segment, Adobe Launch. The script lives inside a container, and removing it means opening the container, publishing a new version, and checking that no other tag depends on the chat variables. GTM in particular keeps firing tags from old container versions until you publish.
  3. Loaded by a third-party plugin. CMS plugins and app-store extensions. Removing the plugin usually removes the tag, but uninstalling is not the same as deactivating, and some plugins keep their scripts in a queue until the next deploy.
  4. Compiled into a bundle. The chat loader is bundled into your main JavaScript by webpack, Vite or similar. Removing it means editing source, rebuilding, redeploying, and invalidating the CDN cache. This is the case where "I removed it from the template" and "the chat is gone from the site" can be weeks apart.

The check at the end of this article covers all four. The point is that removing the visible bubble only proves one of the four paths is clean. The other three still need verification.

What removing the tag actually does

Removing the script tag stops the loader from running on future page loads. It does not retroactively remove anything the loader already wrote on the visitor's device, and it does not stop any chat widget code that was already cached in the browser from a previous visit. A returning visitor whose browser still has the cached HTML and the cached JavaScript bundle will see the chat panel render for a frame or two before the script fails, because the assets are local even when the loader is not.

It also does not stop conversations that are already open. The chat session is a WebSocket connection between the visitor and the vendor's servers, with the script on your page being the renderer. Cut the renderer and the connection lives until the vendor's idle window closes, or until the visitor closes the tab. From the visitor's point of view the chat can vanish mid-conversation, which is the failure mode covered later in how live chat works on a website.

Layer two: what stays in the visitor's browser

This is the layer that creates the most risk after removal, and it is the one nobody looks at because it lives on somebody else's computer. The chat loader typically writes three things into the visitor's browser: cookies, local storage entries, and a service worker in the more advanced products. Each has a different lifetime, and each is set under your domain because the script ran from your page.

Cookies set by the loader

Live chat vendors use first-party cookies, set under your domain, because they need to identify the visitor across page loads within a session. A typical installation plants three to seven cookies: a session identifier, a visitor identifier, a message counter, sometimes an unread-message flag, sometimes a reference to the operator assigned to the chat. The names are vendor-specific but the shape is the same.

Cookie lifetimes vary. Session cookies die when the browser closes. Persistent cookies are usually set for between one month and two years, which is a long time after you have decided the chat product is gone. The cookie attributes that matter here are Domain, Path, Expires or Max-Age, and SameSite. If the cookie is set with Domain=.example.com and Path=/, it lands on every page on the domain, including pages that never had the chat widget.

Local storage entries

Local storage is used for the same reason cookies are, but with a larger per-origin quota and no automatic expiry. A chat loader can typically write between 1 KB and 20 KB into localStorage for the visitor, holding things like the last draft of a message, the visitor's display name, the list of operators the visitor has spoken to, and the unread count. There is no expiry. The entry sits there until your code overwrites it, or until the visitor clears their browser data manually, or until the origin's storage is evicted under browser pressure.

This matters because the cookie banner you put up to satisfy GDPR did not, in most installations, cover local storage. The two are technically separate storage mechanisms and a compliant cookie notice that names cookies does not, by itself, cover localStorage or sessionStorage. If you have ever had a privacy review tell you "the cookie banner does not match what the page is doing," local storage from a chat widget is one of the usual suspects.

The service worker case

Some chat vendors register a service worker so the widget can re-open even if the page is closed, or so push notifications can fire. Service workers are persistent. They survive the page being closed, the tab being closed, the browser being restarted, and the original script being removed from the page. Removing the script tag does not unregister the service worker. The worker keeps running, with whatever scope it was given, until you explicitly call navigator.serviceWorker.getRegistrations() and unregister each one, or until the visitor clears their site data.

You can check this in Chrome by opening DevTools, going to Application, then Service Workers, then looking at the list for your origin. If a worker is registered, its scope, its script URL and the time it was last fetched are all visible. A worker from a chat vendor usually has a script URL on the vendor's domain but is registered under your origin, which is why it shows up here at all.

Layer three: the vendor account

The third layer is the one with the longest half-life. Pulling the script tag is a five-minute change. Removing what the vendor is still storing on its servers, and what it will keep storing until you tell it otherwise, takes longer.

Transcripts and contacts

Every chat that ever happened on your site is a row in the vendor's database, with the visitor's identifying cookies, the messages, the operator notes, any files shared, the page the visitor was on when the chat opened, and often the referrer. By default, vendors keep this for between 6 months and 7 years depending on the product, the plan and the jurisdiction. Some products allow per-conversation deletion; some only allow bulk deletion; some only allow retention configuration within certain plans.

Deleting the account does not necessarily delete the data immediately. Most vendors run a soft delete first, with hard deletion happening at the end of a retention window, and a subset will keep anonymised aggregates for product analytics. Read the data processing addendum before you assume that closing the account is the same as deleting the conversations.

Operator seats and billing

Removing the script does not stop the subscription. The vendor will keep charging you for any seats you are still paying for, on whatever cycle you signed up to, until you cancel. This is the line item that catches people out three months later when a small charge appears on a card they had forgotten was on file. The fix is to cancel inside the account, not just stop using it, and to confirm with a screenshot or an email receipt that the cancellation took. Auto-renewal is the default on most subscription products.

API keys and integrations

If the chat product was wired to your CRM, your helpdesk, your Slack or your data warehouse through an API key or an OAuth grant, the integration is still live after you take the script off the page. The vendor's servers are still pulling contacts, still pushing transcripts, still sending events into the connected system. Revoking the integration is a separate step in the vendor's admin panel, and on the connected system's side too, because most products do not propagate a chat-side deletion into the connected system. The transcripts you thought were deleted will sit in your CRM until you delete them there.

What you are still responsible for

This is the part that surprises people. Even after the script is gone, after the cookies are explained, after the account is closed, you are still the data controller for the personal data the chat vendor processed on your behalf, for as long as that data exists anywhere. Under GDPR this means a deletion request from a visitor applies to you, and you have to chase the vendor to honour it. Under CCPA it means the data sale disclosures still cover the chat data until it is gone from the vendor's backups. Closing the account reduces your surface, it does not eliminate it.

What happens to conversations already in flight

This is the failure mode people discover the hard way. A live chat session is a live connection. Three things can happen to it when you remove the script tag, and which one applies depends on what you actually changed.

If you only removed the script tag

The visitor loses the chat panel. The WebSocket connection on the vendor's side stays open until the vendor's idle window closes (commonly between 30 seconds and 5 minutes) and the operator, if there is one, sees the conversation as "visitor disconnected." The visitor does not see the operator's replies, because the renderer is gone, and the visitor cannot type, because the input field is gone. From the visitor's point of view the chat has simply stopped working, with no error and no explanation. From the operator's point of view the conversation is sitting in the queue waiting for someone to type.

If you removed the script and closed the vendor account

Worse. The WebSocket is severed, the vendor's servers stop accepting new messages from the visitor, and the conversation ends in an error state on the operator side. Any operator still logged in sees the chat close with a transport error, which is a confusing thing to see if they were mid-sentence to a customer about a billing issue.

If you removed the script and forgot to redirect the inbox

Worst. Visitors who had the chat open at the moment of the deploy and who refresh the page see no chat. Visitors who navigate to the page from a tab that was already open see a broken widget. New visitors see nothing. Any contact form, ticket form or email fallback that was supposed to pick up the overflow is still sitting there, and your support volume for the next 24 hours will be the people who could not get hold of you during the cutover.

The mitigation is the same in all three cases: before you remove the script, set the widget to a closed state with a visible message ("Chat is closed, please email support@…") for at least 24 hours, drain the queue, then remove the tag. Closing the inbox before cutting the loader is the difference between "we are upgrading" and "we disappeared."

The exact checks to confirm the widget is really gone

Five checks, in order. Each is something you can run today. If any of them fails, the widget is not fully removed, and you have more to do.

  1. View source on every template that had the tag. Open the live page in a browser, view source, and search for the vendor's hostname. The string should not appear anywhere in the HTML. Do this on desktop and mobile templates, on staging and production, and on every locale if the site is multi-language.
  2. Open DevTools, Network tab, hard reload, filter by the vendor's domain. With the Network panel open and a filter on the vendor's hostname, hard-reload the page. There should be zero requests to that domain. Zero includes zero on subsequent navigations, on form submits, and on any background AJAX your theme fires.
  3. Open DevTools, Application tab, check Cookies, Local Storage, Session Storage and Service Workers for your origin. Each of the four should be empty of any key whose name starts with the vendor's prefix. In Chrome: Application > Storage > Clear storage does this in one go for visitors, but for your own check, you want to see what is there before clearing. Look at the Expiry or Max-Age column on each cookie to see how long it would have stayed.
  4. Search your codebase, including compiled bundles. A grep for the script's variable name across the entire repository. Then grep the compiled output, because source can be clean while the bundle is not. Then grep any tag manager container exports you have.
  5. Test from a clean browser, on a different network, with cookies cleared. A returning visitor's browser, with the old cookies and the cached assets, is not the same as a fresh browser. Test from an incognito window on a phone tethered to a different network, with no cookies, and confirm that the panel does not render. Cached assets in a returning visitor's browser can keep the widget visible for one or two page loads after the script is removed from the server.

If all five checks pass, the widget is gone from the visitor's experience. If any one fails, the table below is what each failure mode points to.

Check that fails What it means
View source finds the hostname The script is still in a template, a tag manager or a compiled bundle. Edit the source, republish the tag manager version, or rebuild and redeploy.
Network tab shows requests A tag, plugin or theme file is still firing the loader. Usually a snippet manager, a header injection from your hosting provider, or a third-party plugin you forgot.
Application tab shows cookies or local storage The loader ran at least once. Clear the storage, then check what fired the loader, because the script is still being requested even if the panel does not render.
Service worker registered The vendor installed a persistent worker. Unregister it, then check whether anything is still loading it. A worker can re-register itself if the loader still runs.
Codebase grep finds references There are call sites that initialise the widget. Even if the script tag is gone, those call sites will throw errors, and the loader may be loaded lazily by the call site.

How long the leftovers actually last

The durations below are the ranges these storage mechanisms allow, not a measurement of any particular vendor. Read the real lifetimes off your own site: the Expires column in the Application tab tells you exactly what your loader set.

Session cookies = until the browser tab closes, typically
Persistent cookies (lower bound) = 30 days
Persistent cookies (upper bound) = 2 years
Local storage entries = until manually cleared or evicted
Service worker = until unregistered or site data cleared
Cached HTML and JS = until the cache expires, typically hours to days
Plan cleanup for the long end, not the short end.

The long end of that range is what matters for compliance. A two-year cookie means that two years after you decided to remove the chat product, a visitor who landed on your site once during the chat's tenure still has a first-party cookie set by your domain, with whatever visitor ID it contained, until that cookie expires on its own. Whether that cookie is personal data depends on whether the visitor ID can be tied back to a person, and under most privacy frameworks a stable visitor identifier tied to a session is personal data. The cookie does not stop being your responsibility when you stop using the chat product.

The mistake that costs the most

Across the teams that have done this badly, the same mistake shows up: they removed the script, watched the chat bubble disappear, marked the ticket done, and discovered weeks later that one of three things was still true. The subscription was still charging. The vendor was still receiving transcripts from returning visitors whose cookies were still valid. Or a privacy request came in from a former visitor, and the team had no record of what data was held, because they had never read the retention settings before deleting the account.

The cost of each of those is different. The subscription is a recoverable cost, usually a few hundred dollars on a card. The transcripts-still-flowing case is harder, because it implies the loader was still installed on at least one template, which means the removal was not actually complete and a second audit is needed. The privacy request case is the expensive one, because the data subject has a right to know what you hold, and "I don't know, we removed the chat" is not an answer that satisfies a regulator. Knowing what was held, when, and for how long, in advance of the request, is the difference between a one-week response and a six-week one.

If you are replacing the chat, not removing it

Most teams removing a chat widget are not removing chat. They are switching from one chat product to another, and the work is the same with a replacement tag at the end of it. Two things change.

First, the new vendor's cookies and local storage entries get planted on the same visitor, on the same domain, alongside the old vendor's data, until the old cookies expire. For a two-year cookie that means two years of dual presence on the visitor's browser, with the old vendor's identifier and the new vendor's identifier coexisting. If you care about cookie count, which is usually a privacy concern, this is a reason to time the swap to the natural expiry of the old cookies rather than doing it on day one.

Second, the visitor continuity question. A returning visitor who had an open chat with the old product will not be recognised by the new product, because the visitor IDs are different. The visitor opens the new chat, has to identify themselves again, and loses the context from the prior conversation. If continuity matters, export the visitor list from the old product and import it into the new one before the cutover, so the new product can match on email or on a hashed identifier. Most products support this. None of them do it by default.

If you are switching to an AI chat agent and want a clean cutover, Asyntai installs as a single script tag, writes first-party cookies under your domain, and exposes a configurable retention window so the data lifecycle is yours to set, not the vendor's. You can review the install path on asyntai.com.

Sources. Cookie, local storage and service-worker behaviour is described from how those browser mechanisms work. The checks in this article are the ones to run in Chrome DevTools on your own site, which is where the real lifetimes your loader set are readable. Idle-window, retention and soft-delete behaviour vary by vendor and belong in the data processing addendum you signed. Asyntai install and retention behaviour from asyntai.com, checked September 2026.

Explore Our Solutions

Find the right AI chatbot for your platform and use case.

Blog in other languages: Deutsch Français Português

Answer from the pages you already have

Asyntai reads your existing content and answers visitors from it, from $39 a month.

Start free