Notification

G Suite is now Google Workspace: everything your business needs to get work done.

Custom tags

If you need to implement a tag that is not yet supported natively by Tag Manager, you can use a custom image, HTML, or function tag.

The best way to avoid performance and malware issues is to use the tag templates built into Tag Manager. Tag manager supports many tag platforms. Tag Manager supports several 3rd party tag templates, and many more templates are shared in the Community Template Gallery.

Custom image tag

The Custom Image tag is used to deploy a pixel tag. 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 as provided by the vendor. 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 deploy a tag that isn't yet supported via Tag Manager. This code will be provided to you by the tag vendor.

Use Sandboxed JavaScript for the code formatting. For more information on converting an existing custom tag to Sandboxed JavaScript, see Convert an existing tag.

To create a new Custom HTML tag:

  1. Click Tags and then New.
  2. Click Tag Configuration and select Custom HTML.
  3. Copy the tag code provided by the 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 add a Tag Manager variable in your custom HTML, wrap the variable's name in double braces:

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

To inspect differences between versions of your custom HTML tags:

  1. Click Versions.
  2. Click a version entry that has the version of the custom HTML tag that you would like to inspect.
  3. In the Version Changes card, click the name of the custom HTML tag to view the configuration changes.
  4. Click View details View Details to expand the code with differences highlighted.
Note: Tag Manager minifies the code for Custom HTML tags and this can change single quotes to double quotes.

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 helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
13130808369787540725
true
Search Help Center
true
true
true
true
true
102259
false
false