Custom tags

If you need to implement a tag that is not explicitly supported via a template, you can use a custom image, HTML, or function tag. Custom tags will allow you to deploy virtually any tag from Google Tag Manager.

The best way to avoid performance and malware issues is to use the tag templates built into Tag Manager. Tag manager supports many 3rd party tag platforms. If a tag you'd like to deploy isn't yet built into Tag Manager, ask the tag provider to apply to join the Google Tag Manager Tag Vendor Program.

Custom image tag

The Custom Image tag is used to set up a pixel tag that is not yet natively supported by Tag Manager. To create a new Custom Image tag:

  1. Click Tags and then New.
  2. Click Tag Configuration and select Custom Image.
  3. Enter the Image URL. Use "//" if protocol-relative versions of the image are available. Use "https://" if only a secure version is available. Use of "http://" is not recommended.
  4. To ensure that hits are registered from browsers that have cached versions of a pixel, select Enable Cache Busting. This will append the query gtmcb=<random number> to the URL. To change the default query parameter, enter a value other than gtmcb in the Cache Busting Query Parameter field.

Custom HTML tag

The Custom HTML Tag type allows you to manage a tag that isn't explicitly supported via a Google Tag Manager, such as 3rd party tags, that have not yet been integrated into Tag Manager as a tag template. Usually this code will be provided to you by the tag vendor.

To create a new Custom HTML tag:

  1. Click Tags and then New.
  2. Click Tag Configuration and select Custom HTML.
  3. Copy the code provided by the tag vendor and paste it into the HTML field, or enter your own custom HTML or JavaScript code. Note: Always place JavaScript inside <script></script> HTML tags.

If needed, select Support document.write to enable calls to document.write() in your JavaScript code.

To use a Tag Manager variable with your custom HTML, wrap the variable name in double braces:

<script>
  var foo = {{bar}};
</script>

Function call tag

In mobile app containers, the Function Call tag allows you to execute pre-registered functions. When you specify a class that you'd like to invoke in a Function Call tag, you can configure a trigger that will cause that function to execute as well as pass arguments to it as key/value pairs. The Function Call tag can be used to extend tag management functionality with 3rd party SDKs.  

To learn more, read the iOS and Android developer documentation.

Was this article helpful?
How can we improve it?