#GTMTips: Decorate Links And Decorate Forms Tag Types
Google Tag Manager implements the cross-domain tracking plugin quite handily via the Universal Analytics tag template, and often the easiest way to track links and form submits is to use the Auto-Link Domains option, as described in this great series of posts on cross-domain tracking by Bounteous.
However, sometimes you want more precision in decorating the URLs. Perhaps you only want to decorate one specific link rather than all links that share the same hostname. Or perhaps you only want to decorate forms when they are submitted by your actual visitors rather than internal users.
This is where the quite rare Decorate Links and Decorate Forms Universal Analytics tag types come in handy.X
The Simmer Newsletter
Subscribe to the Simmer newsletter to get the latest news and content from Simo Ahava into your email inbox!
Tip 86: Decorate Links and Decorate Forms tags
The principle is very simple. If you set the Decorate Links tag to fire with a Just Links trigger, then any link click that causes that trigger to go off will be decorated by the tag. Similarly, if you set the Decorate Forms tag to fire with a Form trigger, then any form submit that toggles that trigger will have its destination URL decorated by the tag.
For example, if you create a Just Links trigger with the following condition:
Click URL matches RegEx
Then any click on a link whose
shop.domain.com/cart/ will be decorated with cross-domain parameters. However, unlike the Auto-Link Domains plugin, no other link to shop.domain.com will be decorated.
This can be very useful if you want full control over when Client ID information is passed from domain to domain.