{"id":36597,"date":"2016-07-01T01:42:13","date_gmt":"2016-06-30T20:12:13","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=36597"},"modified":"2016-08-24T12:15:35","modified_gmt":"2016-08-24T06:45:35","slug":"click-event-tracking-using-google-tag-manager-v2","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/click-event-tracking-using-google-tag-manager-v2\/","title":{"rendered":"Click Event Tracking using Google Tag Manager V2"},"content":{"rendered":"<p>From the\u00a0analytics point of view, tracking user behaviour helps you a lot in defining\u00a0the design of your web pages and making better business decisions. Based on user interaction data, you can make apt <a title=\"front-end development\" href=\"http:\/\/www.tothenew.com\/front-end-angularjs-development\">refinements in your design<\/a> and take smart business decisions.<\/p>\n<p>Actually, the current web page layout you are viewing for this post has been drawn based on the user behaviour\u00a0data from\u00a0Google analytics.<\/p>\n<p>An important element in tracking user behaviour is link click tracking. In terms of Google analytics, it is also known as user click tracking, click event tracking,\u00a0on click event tracking and internal link click tracking.<\/p>\n<p><em>Note: This post is <strong>not about<\/strong>\u00a0external \/ outbound links click tracking<\/em>.<\/p>\n<p>You\u00a0can track click events either\u00a0by making changes in Google analytics tracking code or simply using\u00a0Google tag manager.\u00a0I prefer using Google tag manager as it replaces the hard-coded tags with dynamic tags that are easier to implement and update without any dependency on web developers.<\/p>\n<p>This blog post is a step by step tutorial both for beginners and experts for\u00a0setting\u00a0up a click event tracking using Google tag manager version 2.<\/p>\n<p>I am assuming that you have already set up your Google tag manager account.<\/p>\n<p><strong>Clicks Tracking on a link via Google Tag Manager (GTM)<\/strong><\/p>\n<p>Following is an\u00a0example of few\u00a0links on a web page:<\/p>\n<p>&lt;a id=\u201dAmericas\u201d href=\u201dhttp:\/\/example.com\/Americas\u201d &gt;Americas&lt;\/a&gt;<br \/>\n&lt;a id=\u201dAU-NZ\u201d href=\u201dhttp:\/\/example.com\/AU-NZ\u201d &gt;Australia and New Zealand&lt;\/a&gt;<br \/>\n&lt;a id=\u201dEurope\u201d href=\u201dhttp:\/\/example.com\/Europe\u201d &gt;Europe&lt;\/a&gt;<br \/>\n&lt;a id=\u201dHG-MC\u201d href=\u201dhttp:\/\/example.com\/HG-MC\u201d &gt;Hong Kong &amp; Macao&lt;\/a&gt;<br \/>\n&lt;a id=\u201dIndia\u201d href=\u201dhttp:\/\/example.com\/India\u201d &gt;India&lt;\/a&gt;<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/21.png\" alt=\"google-analytics-click-tracking-sample-gtm-linkclick\" width=\"244\" height=\"204\" \/><\/p>\n<p style=\"text-align: center;\"><em>Sample\u00a0Link<\/em><\/p>\n<p style=\"text-align: left;\"><b>Step 1:<\/b> Login to Google Tag Manager (https:\/\/tagmanager.google.com\/).<\/p>\n<p>After login, you will get a screen similar to the following screenshot:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-36612\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/11.png\" alt=\"google-tag-manager-event-tracking-login\" width=\"1338\" height=\"336\" \/><\/p>\n<p><strong><b>Step 2: <\/b><span style=\"font-weight: 400;\">In the top navigation<\/span><b>, <\/b><span style=\"font-weight: 400;\">click on &#8220;Container&#8221;.<\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/31.png\" alt=\"google-tag-manager-containers\" width=\"1336\" height=\"496\" \/><\/p>\n<p><b>Step 3<\/b><span style=\"font-weight: 400;\">: Navigate to your Google tag manager (GTM) account, click on the &#8220;Variables&#8221; link in the\u00a0left navigation and then <strong>enable all the \u2018built-in variables\u2019<\/strong> of type: Pages, Clicks, and Forms.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/enabling-built-in-variables-gtm.jpg\" alt=\"enabling-built-in-variables-gtm\" width=\"378\" height=\"310\" \/><\/p>\n<p><b>Step 4:<\/b><span style=\"font-weight: 400;\"> Go to &#8220;Triggers&#8221; on left navigation in Google tag manager.<\/span><\/p>\n<p><b>Step 5:<\/b><span style=\"font-weight: 400;\"> Click on \u201cNew\u201d to create a new trigger.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/41.png\" alt=\"auto-event-tracking-google-tag-manager-trigger\" width=\"672\" height=\"333\" \/><\/p>\n<p><b>Step 6:<\/b><span style=\"font-weight: 400;\">\u00a0Give a name to the trigger, say \u201cAmericas\u201d (the same text as in the example above), then select \u201cClick\u201d and &#8220;Continue&#8221;.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/51.png\" alt=\"event-tracking-google-tag-manager-new trigger\" width=\"1205\" height=\"473\" \/><\/p>\n<p><strong><b>Step 7:<\/b><span style=\"font-weight: 400;\"> Next, under \u201cConfigure Trigger\u201d select &#8220;Just Links&#8221; from the dropdown. Next, check wait for tags and put a value of 1 under max wait time and check the checkbox of \u201cCheck Validation\u201d and click on &#8220;Continue&#8221;.<br \/>\n<\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/americas.png\" alt=\"configure-google-tag-manager-event\" width=\"676\" height=\"284\" \/><\/p>\n<p><b>Step 8: <\/b><span style=\"font-weight: 400;\">Under Enable When, select \u201cPage URL\u201d from the first drop-down, \u201ccontains\u201d from second drop down and write the URL of your website without http\/s and www (example.com) in the textbox and click &#8220;Continue&#8221;.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/13.png\" alt=\"gtm-click-select-Page-URL\" width=\"973\" height=\"267\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><b>Step 9:<\/b><span style=\"font-weight: 400;\"> Go to \u201cFire On\u201d and select &#8220;Some clicks&#8221;.<\/span><\/p>\n<p><b>Step 10:<\/b><span style=\"font-weight: 400;\"> Define the trigger to \u201cfire on\u201d at what conditions. To track a click on &#8220;Americas&#8221; text link (anchor text), we have to select &#8220;Click Text&#8221;, append a condition \u201ccontains\u201d and write the desired text \u201cAmericas\u201d.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/14.png\" alt=\"select-trigger-track-anchor-text\" width=\"973\" height=\"208\" \/><\/p>\n<p><b>Step 11:<\/b><span style=\"font-weight: 400;\"> Repeat the<\/span><b> steps 8 to 11 to create triggers for each of the text<\/b><span style=\"font-weight: 400;\">\u00a0(anchor text) to be tracked. So, total you need to create 5\u00a0triggers. <\/span><\/p>\n<p><b>Step 12:<\/b><span style=\"font-weight: 400;\"> Navigate to \u201cTags\u201d on the\u00a0left-hand navigation and click on \u201cNew\u201d.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/71.png\" alt=\"gtm-tag-creation\" width=\"485\" height=\"336\" \/><\/p>\n<p><b>Step 13:<\/b><span style=\"font-weight: 400;\"> Create a new tag with a name like &#8220;Click Country&#8221; while selecting Google Analytics as a product.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/81.png\" alt=\"event-tracking-google-analytics\" width=\"847\" height=\"359\" \/><\/p>\n<p><b>Step 14:<\/b><span style=\"font-weight: 400;\"> Select &#8220;Universal Analytics&#8221; and then click on &#8220;Continue&#8221;.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/9.png\" alt=\"google-analytics-click-tracking\" width=\"805\" height=\"350\" \/><\/p>\n<p><b>Step 15:<\/b><span style=\"font-weight: 400;\"> Next, configure the tag with following values:<\/span><\/p>\n<p><b>Tracking ID<\/b><span style=\"font-weight: 400;\"> &#8211; Place your Google Analytics Tracking ID<br \/>\n<\/span><b>Track Type<\/b><span style=\"font-weight: 400;\"> &#8211; Event<br \/>\n<\/span><b>Category<\/b><span style=\"font-weight: 400;\"> &#8211; {{Click Text}} | {{Page URL}}<br \/>\n<\/span><b>Action<\/b><span style=\"font-weight: 400;\"> &#8211; {{Page URL}}<br \/>\n<\/span><b>Label<\/b><span style=\"font-weight: 400;\"> &#8211; {{Click Text}}<br \/>\n<\/span><b>Non-Interaction Hit <\/b><span style=\"font-weight: 400;\">&#8211; False<\/span><\/p>\n<p><em><strong>Click Text<\/strong><\/em> &#8211; It will display the anchor text being clicked.<br \/>\n<em><strong>Page URL<\/strong><\/em> &#8211; It will display the source page on which the link is present.<\/p>\n<p>Having\u00a0both click text and page URL will help in\u00a0<strong>advanced filtering<\/strong> and using\u00a0<strong>secondary dimensions.<\/strong><\/p>\n<p><b>Step 16:<\/b><span style=\"font-weight: 400;\"> Configure the \u201cFire ON\u201d by selecting \u201cMore\u201d.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/111.png\" alt=\"google-tag-manager-firing-rules\" width=\"1017\" height=\"447\" \/><\/p>\n<p><b>Step 17:\u00a0<\/b>Select<b> all the 5\u00a0triggers you have created earlier<\/b><span style=\"font-weight: 400;\"> from the provided list.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/15.png\" alt=\"all-gtm-triggers-created\" width=\"1068\" height=\"615\" \/><\/p>\n<p><b>Step 18: <\/b><span style=\"font-weight: 400;\">Click on &#8220;Save&#8221; tag.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/16.png\" alt=\"gtm-linkclick-save-tags\" width=\"1054\" height=\"326\" \/><\/p>\n<p>Now you are done with all the settings in Google tag manager.<\/p>\n<p><b>How to check if the events creation is correct or not ?<\/b><\/p>\n<p>One of the common search queries is &#8220;google analytics event tracking not working&#8221;.<\/p>\n<p>So, after creating all the\u00a0tags and triggers, we need to check if these are working fine or throwing an error. Here are a few steps to verify the click event tracking implementation:<\/p>\n<p><b>Step 1:\u00a0<\/b><span style=\"font-weight: 400;\">Select debug mode in GTM.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/debug-mode.png\" alt=\"gtm-debug-mode\" width=\"635\" height=\"419\" \/><\/p>\n<p><b>Step 2: <\/b><span style=\"font-weight: 400;\">Open your website in a\u00a0new tab in the\u00a0same browser. You will find a section in the footer side, where you will get information about tags being fired or not on that page.<\/span><\/p>\n<p><b>Step 3:<\/b><span style=\"font-weight: 400;\"> Click on a targeted link say Americas, you will find a GTM tag fire on it (shown in the footer window).<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/implementation-verification.png\" alt=\"gtm-implementation-verification\" width=\"757\" height=\"214\" \/><\/p>\n<p><b>Step 4:<\/b><span style=\"font-weight: 400;\"> If you get a\u00a0message &#8220;Tag Fired on This Event&#8221;, it indicates that the event creation is successfully done.<\/span><\/p>\n<p><strong><b>Step 5:<\/b><span style=\"font-weight: 400;\"> Verify this click event in Google Analytics: To track this click event, go to Google analytics and check event in real time, you will find your click event in Google analytics.<\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/18.png\" alt=\"google-analytics-event-tracking\" width=\"1270\" height=\"513\" \/><\/p>\n<p><b>Step 6<\/b><span style=\"font-weight: 400;\">: If successful, click on publish on top right-hand side in Google tag manager.<\/span><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/06\/17.png\" alt=\"publish-gtm-container\" width=\"1359\" height=\"509\" \/><\/p>\n<p>This is how you will be able to track the clicks on the desired anchor texts using Google tag manager and Google analytics.<\/p>\n<p>Stay tuned for my next post on implementing scroll depth using Google tag manager V2 and tracking it using Google analytics.<\/p>\n<p>Let&#8217;s discuss your queries in the comments below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From the\u00a0analytics point of view, tracking user behaviour helps you a lot in defining\u00a0the design of your web pages and making better business decisions. Based on user interaction data, you can make apt refinements in your design and take smart business decisions. Actually, the current web page layout you are viewing for this post has [&hellip;]<\/p>\n","protected":false},"author":193,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":4},"categories":[2251],"tags":[1397,3624,3618,3623,3621,171,3620,3625,3607,3619,3622,3617],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/36597"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/193"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=36597"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/36597\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=36597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=36597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=36597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}