Skip to content

Using the Google Analytics Autotracker Javascript Library

Will Strohl edited this page Sep 30, 2018 · 3 revisions

What is the Google Analytics Autotracker?

In the words of the project owners, "It provides default tracking for the interactions most people care about, and it provides several convenience features (e.g. declarative event tracking) to make it easier than ever to understand how people are interacting with your site."

Learn more about this project at the Autotracker project home

How do you use the Google Analytics Autotrack Javascript Library extension?

It's simple:

  1. Install it into DNN like you would any other extension.
  2. (Only if necessary) Update Google Analytics in DNN to use the Universal Analytics:
  1. Update your Google Analytics script (SiteAnalytics.config) using the Configuration Manager to use the plugins you desire.
  2. Save your updates.
  3. Add a reference to this library using your preferred method (there are more than the 2 listed below):
  • Add it to your theme using CRM markup:
    <%@ Register TagPrefix="dnn" TagName="JavaScriptLibraryInclude" Src="~/admin/Skins/JavaScriptLibraryInclude.ascx" %>
    <dnn:JavaScriptLibraryInclude runat="server" Name="GoogleAnalytics-Autotrack" />
  • Add it programmatically in a theme or module using CRM in code-behind:
    using DotNetNuke.Framework.JavaScriptLibraries;
    JavaScript.RequestRegistration("GoogleAnalytics-Autotrack");
  1. Check your GA dashboard in 24 hours to see the new data being tracked.
Clone this wiki locally