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:
- Click Tags New.
- Click Tag Configuration and select Custom Image.
- 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.) - 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 thangtmcb
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.
To create a new Custom HTML tag:
- Click Tags New.
- Click Tag Configuration and select Custom HTML.
- 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:
- Click Versions.
- Click a version entry that has the version of the custom HTML tag that you would like to inspect.
- In the Version Changes card, click the name of the custom HTML tag to view the configuration changes.
- Click View Details to expand the code with differences highlighted.
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.