Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GTM container size over limit: how to fix a failing publish

TRK-125Low impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

Every Google Tag Manager (GTM) container has a maximum size. The size counts everything in the published version: tags, triggers, variables, templates and the code inside Custom HTML tags. When a new version would push the container over that limit, GTM refuses to publish it and shows an error instead.

The limit is rarely hit by a small site. It tends to happen on containers that have been used for years, passed between agencies, or filled with pasted-in scripts. Google sets the exact limit and can change it, so check the error message in your workspace rather than relying on a number from an old article.

Why it costs you leads or sales

The live site keeps running the last version that did publish. So nothing visibly breaks, which is why this is easy to miss. The cost is that every change you make after that point stays stuck in the workspace: a new conversion tag, a fixed trigger, an updated pixel ID.

Ad platforms then keep optimising on old or missing conversion data. The business impact is usually low at first, but it grows the longer fixes stay unpublished.

How a failed publish leaves tracking stale
  1. Edit tagsYou add or fix a tag in the workspace
  2. PublishGTM rejects the version: container too large
  3. Live siteStill runs the old version
  4. Ad dataNew conversions never reported

The live container stays on the old version, so later changes never run.

How to check if your site has it

Confirm the size problem
  1. Try to publish

    In GTM, click Submit, then Publish. If the container is too big, GTM shows an error about size instead of creating the version.

  2. Check the workspace for the size indicator

    Open Admin, then Container, and look at the container details and any size warning GTM shows. Google may show a gauge as you approach the limit.

  3. Compare to the live version

    Open Versions and note the date of the last published version. If it is older than your recent edits, publishes have been failing.

  4. Find the heaviest items

    Export the container (Admin, Export Container) and open the JSON file in a text editor. Long Custom HTML tags and large lookup tables stand out quickly.

How to fix it

Work from the safest cuts to the riskiest. Always take a backup first.

Shrink the container and publish
  1. Back up the container

    Go to Admin, Export Container, choose the current workspace and download the JSON. You can import it back if a cut goes wrong.

  2. Delete unused items

    In the Tags, Triggers and Variables lists, look for items that nothing uses. GTM marks unused variables and triggers, so start there. Remove paused tags for platforms you no longer run.

  3. Remove duplicates and old tests

    Look for copies of the same tag (for example '... copy'), old agency tags and leftover test tags. Check the tag's firing history in Preview before deleting.

  4. Slim down Custom HTML tags

    Large pasted scripts are the usual cause. Replace them with a Community Template Gallery template for that vendor where one exists, or load the script from a file on your own site with a short tag.

  5. Trim big lookup tables

    Lookup and regex tables with hundreds of rows add up. Drop rows for retired pages or products, or move the mapping into your dataLayer.

  6. Split if it is still too big

    If everything is needed, move a separate concern (for example a second site or a heavy third-party suite) into its own container and load both.

  7. Publish and name the version

    Click Submit, give the version a clear name such as 'Size cleanup', and publish.

Example: replace a long inline script with a small loader tag (Custom HTML)html
<script>
  (function(){
    var s = document.createElement('script');
    s.src = 'https://www.example.com/assets/vendor-widget.js';
    s.async = true;
    document.head.appendChild(s);
  })();
</script>
Container before and after cleanup

Over the limit

  • Publish fails with a size error
  • Dozens of paused and duplicate tags
  • Large scripts pasted into Custom HTML
  • Changes stuck in the workspace

Within the limit

  • Publish succeeds
  • Only tags that are in use
  • Short loader tags or templates
  • Changes go live as intended

How to confirm it's fixed

Confirmation checks
  • Publish completes with no size error
  • The Versions list shows your new version as Live
  • Open the site with GTM Preview (Tag Assistant) and confirm the new or fixed tags fire
  • Check in GA4 DebugView or your ad platform's tag diagnostics that the events arrive
  • Re-export the container and compare file size with the backup

How to prevent it happening again

Habits that keep the container lean
  • Run a quarterly audit and delete paused, duplicate and test tags
  • Name tags consistently so unused ones are easy to spot
  • Prefer templates over pasted Custom HTML
  • Host large scripts on your own site and load them with a short tag
  • Remove a vendor's tags when you stop using the vendor
  • Review the container after an agency handover

How FunnelGuard handles this

This issue is outside what FunnelGuard checks. A container size limit and a failed publish happen inside the GTM admin, not on your live pages, so a robot visitor running your customer journeys cannot see them. The kind of tool that fits is a GTM container audit or tag management governance tool, or simply the GTM workspace itself and its exported JSON.

Where FunnelGuard helps is the effect further down the line. It runs your real journeys on a schedule and checks whether the tracking hits to GA4, Google Ads, Meta and other platforms are actually sent. You can use that to check the tags you expected to go live after the cleanup. A free plan covers 1 site and 2 journeys.

Questions people ask

Why won't Google Tag Manager let me publish my container?

One common cause is that the container is over its size limit. GTM then shows an error when you click Publish and does not create the version. Reduce the container by removing unused tags, triggers, variables and large Custom HTML, then publish again.

What is the Google Tag Manager container size limit?

GTM caps how large a container version can be, counting tags, triggers, variables and the code inside them. Google sets the exact figure and may change it, so read the number in the error message or in Google's current documentation.

How do I reduce my GTM container size?

Export a backup, then delete unused tags, triggers and variables, remove duplicates and paused tags, and shrink big Custom HTML tags. Replace pasted scripts with templates or short loader tags, and trim large lookup tables.

Does a failed GTM publish break my live tracking?

No, the live site keeps running the last published version. The harm is that every new change stays unpublished, so fixes and new conversion tags never go live until you reduce the size and publish.

Can I split a GTM container into two?

Yes. You can create a second container for a separate concern and load both snippets on the site. Keep clear naming so the two do not fire duplicate tags, which is a separate problem.

Will deleting unused tags in GTM break anything?

Only if a tag is used in a case you did not test. Export a backup first, check the tag in Preview mode and ask the person who set it up. You can import the backup if you need to restore it.

Can FunnelGuard tell me my GTM container is too big?

No. The size limit is a GTM admin issue, which needs a container audit or tag governance tool. FunnelGuard can check that the tracking hits you expect after publishing are sent from your real journeys.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.