Advanced Click and Events Tracking for Google Analytics in Dotnetnuke - by SolTech


Published on

A detailed view on how to track pages, events and click events in dotnetnuke. SolTech is a leading Atlanta-based dotnetnuke fusion partner. We also provide custom software development services across the full range of platforms and technologies.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Advanced Click and Events Tracking for Google Analytics in Dotnetnuke - by SolTech

  1. 1. To provide for click tracking in DNN using Google Analytics, follow these steps. Upgrade the Anayltics with Oliver Hines module at Which generates this before the </body>… <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', "UA-4423739-1"]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-'; ga.setAttribute('async', 'true'); document.documentElement.firstChild.appendChild(ga); })(); </script> SolTech is a leading provider of custom software development, and custom DotNetNuke (DNN) services. Contact SolTech (404) 601-6000 if you need help building a feature rich web2.0 portal.
  2. 2. Adding event tracking By default the code is tracking page views. But it can be enhanced to track clicks or any other event. For example .. Place this anywhere in your code and it will add the event to the Analytics call above.. <script type="text/javascript"> _gaq.push(['_trackEvent', „EventCategory', „EventName', „Comment']); </script> When executed it will generate an event in analytics . More examples .. SolTech. Inc (404) 601-6000
  3. 3. Other event examples Track a URL and an event in one. For example, place this on the thank-you page for a form submission <script type="text/javascript"> _gaq.push(['_trackPageview', '/resumesubmitted.aspx‟]); _gaq.push(['_trackEvent', 'Jobs', 'Viewed', 'Resume Submitted']); </script> NOTE : The url resumesubmitted.aspx does not have to be a REAL url. It can be made up to describe the page you are on. Its used only by google for reporting purposes. More important … go to ANY <a href on your site, wether it be a link or a button and add … onClick="_gaq.push(['_trackEvent', „Categoryname', „Event', „Some comment']);“ Like onClick="_gaq.push(['_trackEvent', „Blog', 'Click', „Blog Visit']);" SolTech. Inc (404) 601-6000
  4. 4. Analytics Reporting of Events In analytics reporting, the links added with _gaq.push(['_trackPageview', '/Careers/AvailablePositons.aspx‟]); Display in the “Content – Overview” While the _gaq.push(['_trackEvent', 'Jobs', 'Viewed', 'Resume Submitted']); And onClick="_gaq.push(['_trackEvent', „Blog', 'Click', „Blog Visit']);“ Display in the Content – Event tracking section of the analytics report. In summary … using injected events with analytics can help one track almost any activity within any page of the website. SolTech. Inc (404) 601-6000
  5. 5. SolTech is a DNN partner SolTech Inc, is an Atlanta-based DNN partner with over 60 full time programmers covering the full spectrum of software development. Besides DNN services that provide complete CMS backed websites and custom modules, we also provide services from .NET, and JAVA, through mobile, iPhone and iPad apps to complete “from scratch” ERP systems. We should be talking. 1-404-601-6000 SolTech. Inc (404) 601-6000