{"id":447,"date":"2014-10-14T12:19:48","date_gmt":"2014-10-14T11:19:48","guid":{"rendered":"https:\/\/blogs.ncl.ac.uk\/t4\/?p=447"},"modified":"2019-05-17T09:36:49","modified_gmt":"2019-05-17T08:36:49","slug":"google-analytics","status":"publish","type":"post","link":"https:\/\/blogs.ncl.ac.uk\/t4\/2014\/10\/14\/google-analytics\/","title":{"rendered":"Visitor Tracking with Google Analytics"},"content":{"rendered":"<p>The best way to track visitors to your T4 site is through Google Analytics \u00a0This allows you to track where (country, city, website) visitors came from as well as what kind of device they were using, how long they stayed on your site and which are your most popular pages.<\/p>\n<p>Note that it&#8217;s only possible to do this once your site has been made live (moved from a dev-research\/something address to just research.ncl.ac.uk\/something)<\/p>\n<p>A <a href=\"https:\/\/support.google.com\/analytics\/?hl=en#topic=3544906\">tutorial<\/a> on google anaytics is out of scope for this blog &#8211; there are <a href=\"https:\/\/www.google.co.uk\/search?q=google+analytics+tutorial&amp;oq=google+analytics+tutorial&amp;aqs=chrome..69i57j69i64.4310j0j4&amp;sourceid=chrome&amp;es_sm=122&amp;ie=UTF-8\">plenty elsewhere<\/a>, but here&#8217;s how to set it up within your T4 site:<\/p>\n<p>Firstly, get an account:\u00a0<a href=\"http:\/\/www.google.com\/analytics\/\">http:\/\/www.google.com\/analytics\/<\/a><\/p>\n<p><a href=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-1-getaccount.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-453\" src=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-1-getaccount-300x218.jpg\" alt=\"google-analytics-1-getaccount\" width=\"300\" height=\"218\" srcset=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-1-getaccount-300x218.jpg 300w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-1-getaccount-1024x745.jpg 1024w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-1-getaccount-412x300.jpg 412w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-1-getaccount.jpg 1280w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8230;and enter the website Name and URL that you wish to track:<\/p>\n<p><a href=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-2-choosesite.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-448\" src=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-2-choosesite-300x218.jpg\" alt=\"google-analytics-2-choosesite\" width=\"300\" height=\"218\" srcset=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-2-choosesite-300x218.jpg 300w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-2-choosesite-1024x745.jpg 1024w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-2-choosesite-412x300.jpg 412w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-2-choosesite.jpg 1280w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>This will give you a <strong>Tracking ID<\/strong> and some code:<\/p>\n<p><a href=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-3-trackingid.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-449\" src=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-3-trackingid-300x218.jpg\" alt=\"google-analytics-3-trackingid\" width=\"300\" height=\"218\" srcset=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-3-trackingid-300x218.jpg 300w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-3-trackingid-1024x745.jpg 1024w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-3-trackingid-412x300.jpg 412w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-3-trackingid.jpg 1280w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Copy this code (CTRL+C), as we&#8217;ll need it later.<\/p>\n<p>Return to T4 and click &#8216;Add Content&#8217; to your <a title=\"Section Sidebars, Banners and Footers\" href=\"https:\/\/blogs.ncl.ac.uk\/t4\/2014\/01\/15\/section-sidebars-banners-and-footers\/\">Section Footer<\/a>. You&#8217;ll have the option to add a content type called &#8216;Raw HTML\/Javascript&#8217;<\/p>\n<p>This content type needs a name (&#8220;Google Analytics&#8221; is as good a name as any) and also gives you a box to paste in the code from above (CTRL+V).<\/p>\n<p><a href=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/ga.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-885\" src=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/ga-300x81.png\" alt=\"\" width=\"300\" height=\"81\" srcset=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/ga-300x81.png 300w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/ga-768x206.png 768w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/ga-1024x275.png 1024w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/ga-500x134.png 500w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/ga.png 1911w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Click &#8220;Update and Approve&#8221; and then next time your site publishes, the Google tracking code will appear in the footer of every page and Google Analytics can start tracking your site.<\/p>\n<p>This may take a few hours, but once it&#8217;s working you&#8217;ll be able to return to Google Analytics and see the real time tracking working on your site:<\/p>\n<p><a href=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-6-live.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-452\" src=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-6-live-300x218.jpg\" alt=\"google-analytics-6-live\" width=\"300\" height=\"218\" srcset=\"https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-6-live-300x218.jpg 300w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-6-live-1024x745.jpg 1024w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-6-live-412x300.jpg 412w, https:\/\/blogs.ncl.ac.uk\/t4\/files\/2014\/10\/google-analytics-6-live.jpg 1280w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The best way to track visitors to your T4 site is through Google Analytics \u00a0This allows you to track where (country, city, website) visitors came from as well as what kind of device they were using, how long they stayed &hellip; <a href=\"https:\/\/blogs.ncl.ac.uk\/t4\/2014\/10\/14\/google-analytics\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":839,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-447","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/posts\/447","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/users\/839"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/comments?post=447"}],"version-history":[{"count":4,"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/posts\/447\/revisions"}],"predecessor-version":[{"id":886,"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/posts\/447\/revisions\/886"}],"wp:attachment":[{"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/media?parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/categories?post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ncl.ac.uk\/t4\/wp-json\/wp\/v2\/tags?post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}