Manage container size and efficiency (2024)

Tag Manager Help

Sign in

Google Help

    Help Center
      Get started with Tag ManagerGet started with the Google tagManage user consent with consent modeManage accounts and containersConcepts and componentsTag setup guidesPrivacy policies
    CommunityTag Manager
    Privacy PolicyTerms of ServiceSubmit feedback

Send feedback on...

  • Help Center
  • Community
  • Announcements

Tag Manager

  • Troubleshoot
  • Manage container size and efficiency

Notification

The Google Analytics: GA4 Configuration tag is now the Google tag. GA4 Configuration tags in a web container will be automatically migrated starting in September. There are no changes to your existing measurement and there is no action required from you. Learn more

Get started with Tag Manager

Next: Malware detection

To ensure that your Tag Manager installation performs at its best, keep the number of tag configurations in each container at a reasonable size. For containers that have large numbers of tags, triggers, and/or variables defined, or have large custom HTML tags, a Size indicator may appear in Tag Manager on the Versions pages. If the Size indicator value is above 70%, you should take steps to optimize your container configuration.

Clean up your container

Combine multiple similar tags with slightly different configurations into a single tag that uses variables to dynamically set the values of certain fields. Example: Ten similar tags, each configured with a trigger that tells each tag to fire on ten separate pages, can be combined into one single tag/trigger combination that uses a Lookup Table variable to set the values of the relevant fields.

Remove any unnecessary tags and variables that are no longer needed. If a tag, trigger, or variable is never used, then it is taking up space in your container unnecessarily.

While it is good to consolidate tags with Lookup Table variables, an excessively long lookup table can also reduce performance. In most cases, you can reduce the size of long Lookup Table variables with a RegEx Table variable.

Split large containers that span multiple sites (or sections of very large sites) into smaller containers. 360 customers can use zones to load multiple containers conditionally.

Be smart about custom code

Minimize or eliminate the use of custom HTML tags, custom JavaScript variables. In most cases, a supported tag template is more efficient. Use built-in tag templates, triggers, and variables instead of custom code whenever possible.

If you must use custom HTML tags and/or JavaScript variables, look for opportunities to improve the efficiency of the code.

Avoid the placement of static JavaScript code in Google Tag Manager. Static JavaScript will be more efficiently served in an external file, where it can be served by a CDN and cached in the web browser.

Implement server-side tagging

If you have to maintain a large number of tags on your website, consider moving some of them onto a tagging server.

Server-side tagging unlocks the following benefits:

  • Improved page speed as the amount of third-party code loaded in the user's browser is greatly reduced.
  • Content security policies can be made more restrictive, as the browser no longer needs to communicate directly with vendor domains.
  • Privacy is improved because personal data such as the user's IP address can be removed from the data dispatched to the vendor.
  • Cookies can be made more secure and durable because they are set on your own domain and are not set by the JavaScript on the page.

If you want to try server-side tagging for yourself, take the free course: Server-side tagging fundamentals.

Next: Malware detection

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

Post to the help community Get answers from community members
Manage container size and efficiency (2024)
Top Articles
Latest Posts
Recommended Articles
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 6415

Rating: 4.7 / 5 (57 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.