Custom tags

If you need to implement a tag that is not explicitly supported via a template, you can create custom image tags or custom HTML tags. Using 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 Google Tag Manager. Tag manager supports a wide number of 3rd party tag templates. If a tag you'd like to deploy isn't yet built into Google Tag Manager, consider reaching out to the tag vendor to ask them to apply to join the Google Tag Manager Tag Vendor Program.

In this article:

Custom image tag

The Custom Image Tag type allows you to manage your own image tag with it's own custom triggers and parameters. For example, if you use a pixel image for tracking, enter the image URL in the Image URL field.

Select "//" if protocol-relative versions of the image are available. Select "https://" if only a secure version is available. Using "http://" is not recommended.

Select the Cache Buster checkbox and provide a cache busting parameter to ensure that hits are registered from browsers that have cached versions of the image.

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.

When creating a Custom HTML tag, you will be presented with a text box. Copy and paste your custom HTML and/or Javascript code where indicated.

When adding JavaScript to the Custom HTML tag, always place the JavaScript code inside <script></script> tags.

You may incorporate calls to document.write() in your tags by selecting the appropriate checkbox.

To insert variables into your custom HTML tag, you can wrap the variable name in double braces, i.e. {{variable_name}}. This can be helpful for tag reuse in multiple contexts.

Add tags independently instead of combining them. For example, if you have two data collection tools side by side in your original site code, break these two tools into two separate Custom HTML tags. Doing so will allow you to independently deploy each tag.

Function call tag

In mobile app containers, the Function Call tag allows you to execute pre-registered functions.

For example, you could implement a function in your app to trigger hits for measurement and remarketing tools that are not currently supported with tag templates. By specifying the class you’d like to invoke in a Function Call tag, you can configure trigger that function to execute, and optionally pass it arguments as key/value pairs. While use of Function Call tags does require some planning, it can be very helpful in extending tag management functionality to the measurement hits associated with other SDKs.

To learn more about implementing Function Call tags, please reference the relevant iOS and Android developer documentation.

Was this article helpful?
How can we improve it?