Getting cross-domain tracking in Google Analytics is tricky. Even if you are using Google Tag Manager. There are several known issues when tracing iframes, for example.
Google Tag Manager implements the cross-domain tracking plugin quite easily via the Universal Analytics tag template, and often the easiest way to track links and form submissions is to use Autolink domains Option, as shown in this great series of posts about cross-domain tracking by Bounteous.
However, sometimes you want more precision in decorating URLs. Maybe you only want to decorate one specific link instead of all links that share the same hostname. Or maybe you just want to decorate the forms when they are submitted by actual visitors rather than internal users.
This is a very rare place decorate links And decorate shapes Universal Analytics tag types are on hand.
Simmer . Newsletter
Subscribe to the Simmer newsletter to get the latest news and content from Simo Ahava right in your inbox!
Very simple principle. If you set a file decorate links sign to shoot with just links the trigger, then any link click that causes the player to stop will be decorated by the tag. Similarly, if you set a file decorate shapes sign to shoot with Form Trigger , then any form that submits this switch that is triggered will have its destination URL emblazoned with the tag.
For example, if you create a file just links Trigger with the following status:
Click on the URL matches regular expression
Then any click on the link that
href it contains
shop.domain.com/cart/ It will be decorated with cross-domain parameters. However, unlike the Auto-Link Domains plugin, There is no other link for shop.domain.com will decorate.
This can be very useful if you want complete control over when client ID information is passed from domain to domain.