Container efficiency

To ensure that your Tag Manager installation performs at it's best, keep the number of tag configurations in each container at a reasonable size. Here are some tips that can help you maintain an efficient container:

Clean up your container

  • Combine multiple similar tags with slightly different configurations into a single tag that uses variables to dynamically set fields that need to change. 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.
  • Minimize or eliminate the use of custom HTML tags, custom JavaScript variables.
  • 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 up 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

  • Replace custom tags with one of the supported tag templates. Use built-in tag templates instead of custom code whenever possible.
  • Look for opportunities to improve the efficiency of the code in your own custom HTML and JavaScript variables.
  • Move static JavaScript code out of Google Tag Manager and into an external file.
Was this article helpful?
How can we improve it?