{"id":151865,"date":"2025-03-23T15:11:04","date_gmt":"2025-03-23T15:11:04","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/gtmtips-track-outbound-links-in-gtm-v2\/"},"modified":"2025-03-23T15:11:04","modified_gmt":"2025-03-23T15:11:04","slug":"gtmtips-track-outbound-links-in-gtm-v2","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=151865","title":{"rendered":"#GTMtips: Track Outbound Links In GTM V2"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<blockquote>\n<p><strong>NOTE 30 Oct 2019:<\/strong> I\u2019ve published <a href=\"https:\/\/www.simoahava.com\/gtm-tips\/track-outbound-links-google-tag-manager\/\">a new article<\/a> on outbound link tracking in Google Tag Manager, which makes the whole process much, MUCH simpler. I strongly recommend you read that article instead.<\/p>\n<\/blockquote>\n<p>Tracking outbound links is important for many. Identifying the exit paths is almost as important as tracking entrances. In this simple <a href=\"https:\/\/www.simoahava.com\/categories\/gtm-tips\/\">#GTMtips<\/a> post, I\u2019ll show you how to track outbound links with a simple Trigger + Auto-Event Variable combination in the new Google Tag Manager interface.<\/p>\n<p>For more information about triggers, variables, and auto-event tracking, here are some of my previous articles on these topics:<\/p>\n<p>                <span class=\"simmer\"><br \/>\n  <span class=\"close\">X<\/span><\/p>\n<p>\n    <span class=\"fa fa-md fa-bell\"\/><br \/>\n    <strong>The Simmer Newsletter<\/strong>\n  <\/p>\n<p>\n    Subscribe to the <a href=\"https:\/\/www.simoahava.com\/newsletter\/\">Simmer newsletter<\/a> to get the latest news and content from Simo Ahava into your email inbox!\n  <\/p>\n<p>  <\/span><\/p>\n<h2 id=\"setting-up-the-variable-and-the-trigger\">Setting up the Variable and the Trigger<\/h2>\n<div style=\"aspect-ratio: 1520 \/ 860;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/01\/track-outbound-links.jpg\" title=\"Track Outbound Links In Google Tag Manager\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"860\" width=\"1520\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/01\/track-outbound-links.jpg#ZgotmplZ\" alt=\"Track Outbound Links In Google Tag Manager\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Tracking outbound links hinges around two things: a <strong>Variable<\/strong> which captures the hostname of the clicked link, and a <strong>Trigger<\/strong>, which fires your Event Tag when the hostname is <em>not<\/em> your domain.<\/p>\n<p>To set up the Variable, create a new <strong>Auto-Event Variable<\/strong>, and call it <strong>Click URL Hostname<\/strong>. You can choose whatever name you want, of course, but this mimics the pattern of the existing Built-In Variables.<\/p>\n<p>The Variable should have the following settings:<br \/><strong>Type:<\/strong> Auto-Event Variable<br \/><strong>Variable Type:<\/strong> Element URL<br \/><strong>Component Type:<\/strong> Host Name<\/p>\n<p>If you want, you can choose to \u201cStrip www.\u201d, meaning the Variable will return the same, www-less value for both <strong><a href=\"http:\/\/www.mydomain.com\">www.mydomain.com<\/a><\/strong> and <strong>mydomain.com<\/strong>.<\/p>\n<p>For the Trigger, you\u2019ll need to create a new Click Trigger which has a filter for your site\u2019s hostname.<\/p>\n<ol>\n<li>\n<p>Create new <strong>Just Links<\/strong> trigger<\/p>\n<\/li>\n<li>\n<p>Check \u201cWait for Tags\u201d and \u201cCheck Validation\u201d<\/p>\n<\/li>\n<li>\n<p>For the \u201cEnable this trigger when\u2026\u201d condition, set <strong>Page URL contains \/<\/strong><\/p>\n<\/li>\n<li>\n<p>Select the radio button for <strong>Some Link Clicks<\/strong><\/p>\n<\/li>\n<li>\n<p>Set the last condition to: <strong>Click URL Hostname<\/strong> does not contain <strong>mydomain.com<\/strong><\/p>\n<\/li>\n<\/ol>\n<p>Substitute <em>mydomain.com<\/em> with your own domain. You can choose another operator, such as RegEx matching, or the exact match \u201cdoes not equal\u201d operator, depending on how accurate you want the pattern match to be.<\/p>\n<p>To finish off the Trigger, check my <a href=\"https:\/\/www.simoahava.com\/analytics\/auto-event-tracking-gtm-2-0\/\">Auto-Event Tracking guide<\/a> if the options confuse you. The most difficult bit of the new Trigger-based listener is the \u201cEnable When\u201d setting, which determines when the Trigger is actively listening for link clicks. Just add a blanket match to this: <strong>Page URL<\/strong> contains <strong>\/<\/strong>, since it\u2019s quite likely that you want to track link clicks on all your site\u2019s pages, right?<\/p>\n<p>Finally, to make your Event tag fire with this new Trigger, just add it to the Tag:<\/p>\n<div style=\"aspect-ratio: 317 \/ 470;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2015\/01\/trigger-and-tag.jpg\" title=\"Add Trigger To Tag\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"470\" width=\"317\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2015\/01\/trigger-and-tag.jpg#ZgotmplZ\" alt=\"Add Trigger To Tag\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>If you\u2019re wondering how this Trigger works with links that have relative targets, don\u2019t worry. The Trigger works for these as well, since it doesn\u2019t access the href <em>attribute<\/em> of the A element. Rather, it grabs the value from the <em>DOM property<\/em> named <code>href<\/code>, which will always have a fully-formed URL value with the hostname and all.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>NOTE 30 Oct 2019: I\u2019ve published a new article on outbound link tracking in Google Tag Manager, which makes the whole process much, MUCH simpler. I strongly recommend you read that article instead. Tracking outbound links is important for many. Identifying the exit paths is almost as important as tracking entrances. In this simple #GTMtips [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":151866,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[32680,14492,1538,44613,1018],"dealstore":[],"offerexpiration":[],"class_list":["post-151865","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-gtm","tag-gtmtips","tag-links","tag-outbound","tag-track"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>#GTMtips: Track Outbound Links In GTM V2 - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=151865\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"#GTMtips: Track Outbound Links In GTM V2 - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"NOTE 30 Oct 2019: I\u2019ve published a new article on outbound link tracking in Google Tag Manager, which makes the whole process much, MUCH simpler. I strongly recommend you read that article instead. Tracking outbound links is important for many. Identifying the exit paths is almost as important as tracking entrances. In this simple #GTMtips [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=151865\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-23T15:11:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1520\" \/>\n\t<meta property=\"og:image:height\" content=\"860\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=151865#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=151865\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"#GTMtips: Track Outbound Links In GTM V2\",\"datePublished\":\"2025-03-23T15:11:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=151865\"},\"wordCount\":492,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=151865#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg\",\"keywords\":[\"GTM\",\"GTMTips\",\"Links\",\"Outbound\",\"Track\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=151865#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=151865\",\"url\":\"https:\/\/fivemor.com\/?p=151865\",\"name\":\"#GTMtips: Track Outbound Links In GTM V2 - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=151865#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=151865#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg\",\"datePublished\":\"2025-03-23T15:11:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=151865#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=151865\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=151865#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg\",\"width\":1520,\"height\":860},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=151865#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"#GTMtips: Track Outbound Links In GTM V2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"#GTMtips: Track Outbound Links In GTM V2 - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=151865","og_locale":"en_US","og_type":"article","og_title":"#GTMtips: Track Outbound Links In GTM V2 - Som2ny Network","og_description":"NOTE 30 Oct 2019: I\u2019ve published a new article on outbound link tracking in Google Tag Manager, which makes the whole process much, MUCH simpler. I strongly recommend you read that article instead. Tracking outbound links is important for many. Identifying the exit paths is almost as important as tracking entrances. In this simple #GTMtips [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=151865","og_site_name":"Som2ny Network","article_published_time":"2025-03-23T15:11:04+00:00","og_image":[{"width":1520,"height":860,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=151865#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=151865"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"#GTMtips: Track Outbound Links In GTM V2","datePublished":"2025-03-23T15:11:04+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=151865"},"wordCount":492,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=151865#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg","keywords":["GTM","GTMTips","Links","Outbound","Track"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=151865#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=151865","url":"https:\/\/fivemor.com\/?p=151865","name":"#GTMtips: Track Outbound Links In GTM V2 - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=151865#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=151865#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg","datePublished":"2025-03-23T15:11:04+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=151865#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=151865"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=151865#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/03\/track-outbound-links.jpg","width":1520,"height":860},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=151865#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"#GTMtips: Track Outbound Links In GTM V2"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/151865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=151865"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/151865\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/151866"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=151865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=151865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=151865"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=151865"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=151865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}