I use a content management system called
One problem I've ran into when attempting to use Google Analytics with DNN derives from the fact that each page is built dynamically when the user requests the page. A single default.aspx file is used for all page requests, and the content, skin, objects, etc. are injected as elements into this default.aspx file to create the page. On the surface it would seem simple to just copy and paste the Google Analytics code into this single default.aspx file. Some problems arise from this:
- Sometimes multiple sites share this default.aspx file. Tracking reports from Google Analytics will then show the numbers for all these sites (or portals as they are called in DNN parlance)
- Pushing the Google Analytics code into every DotNetNuke page using a single default.aspx file creates an issue with the DNN administrative pages. Not that it hurts anything, but those pages shouldn't be counted in the usage totals - it skews the results.
- If you have any https pages in your site, they will fail the security test because the Google Analytics code uses plain-jane vanilla http requests. (Note - I've seen some workarounds for this, but none have been satisfactory).
- The Google Analytics code shows extremely skewed results for some pages because of the strange way that DotNetNuke builds the URLs for each page. The friendly URL problem will hopefully have a fix in a future release.
- Login as either the DNN administrator or super user (host) account.
- Navigate to your home page
- Add a Text/HTML Module, preferable somewhere unobtrusive like the bottom of the page
- First, change the settings on the Text/HTML module so that the container is invisible (uncheck the 'Display Container' under the Page Settings section) and save your changes.
- Next, click the 'Edit Text' button on the module
- In the Edit Text window, click on the 'Source' button to view the actual HTML. Delete whatever content is in there (if any) and copy and paste your Google Analytics code that you received from Google. Make sure to click the Update button to save the changes.
- Next, go back into the Settings for the module, but this time expand the 'Advanced Settings' tab. Make sure the 'Show on every page' checkbox is checked and click 'Update'
- If you have https pages, navigate to those and manually delete the module from them. You won't be able to track your secure pages (maybe someone has a suggestion about this).
Happy stats!