Adding Google Analytics Tracking code in DNN 9.*

If you’ve setup a new DNN site running on version 9.0 or 9.1, you’ll notice that you don’t have the ability to setup the Google Analytics module/code anymore. For some reason, DNN Corp in its infinite wisdom decided to remove the core, critical functionality from the Platform version of DNN and only leave it in the paid versions.

Well fear not, you can easily add Google Analytics code to your pages, follow these steps.

  1. First step is to go to and sign up, register your site, you’ll be given Tracking code that looks similar to

       (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

      ga('create', 'UA-######-##', 'auto');
       ga('send', 'pageview');


  2. Copy that code, yours will be slightly different, without the #### in place.
  3. Navigate to your Site Settings page within the DNN Persona Bar.
  4. Navigate to the Site Behavior tab
  5. Scroll down to the Page Output Settings section.
  6. Paste the tracking code into the text box there.
  7. Click save at the bottom of the page.

Boom, you’ve now got your tracking code included on all the pages on your site.

Recent Comments

I want to thank you for this post - there is little advice for people getting started with DNN 9X i'm fairly new to DNN and your information is always helpful... a very simple fix....thanks again, allen Much appreciated,,

Posted By: allen Hunsucker on Wednesday, May 17, 2017 8:38 AM
hello Chris Hammond, i have upgraded my test site to dnn evoq 9.1.0 version. and i want to add google Analytics Tracking Code. but i can not find "Page Output Settings section" under Site Behavior tab of Site Settings page. please help
Posted By: Mitesh Patel on Tuesday, June 27, 2017 9:13 AM
The Page Output Settings is at the bottom of the Site Behavior Tab, Default Settings, very bottom...
Posted By: Rob Hunter on Thursday, June 29, 2017 10:05 PM

Thank you - and thank you again for this elegant solution.

Posted By: Lizzy Johnson on Thursday, July 20, 2017 9:40 PM

Google suggests putting the code after the body tag "Add the following line to each template page immediately after the opening

tag", your method (while technically "ok", isn't the recommended method - just to let everyone know) is inputting the code into the head.

Posted By: Phillip Quinlan on Monday, August 28, 2017 8:07 PM

Phillip - incorrect. Correction for your statement here: (Google verbatim) This is the Global Site Tag (gtag.js) tracking code for this property. Copy and paste this code as the first item into the

of every webpage you want to track. If you already have a Global Site Tag on your page, simply add the config line from the snippet below to your existing Global Site Tag. I know there are vendors releasing google analytics modules at a premium for DNN, but this works. More reasons to irk DNN for trying to squeeze profits and shun a good user-experience.

Posted By: Mark Peterson on Tuesday, February 20, 2018 3:16 AM

Chris....this is an absolutely brilliant post. It is something we all are going to need now that the powers that be decided to take it away from us.

Posted By: Ibrahim Malluf on Tuesday, August 14, 2018 9:39 PM

Add Comment

Please add your comment by filling out the field(s) below. Your comment may need to be approved before it becomes visible.
Enter your first name for display with the comment
Enter your last name for display with the comment.
Enter your email address so that we may contact you if necessary. We will also use this for your Gravatar.
Enter the URL to your website. URLs may be removed from comments.
Enter your comment here.
If you can't type Human2 in, you can't post, plain and simple.
Submit Comment Cancel

Chris Hammond is a father, husband, leader, developer and car guy. Chris has long specialized in ASP.NET and DotNetNuke development, so you will find a variety of topics here on the website. For more information check out the about me page.

If you are looking for DotNetNuke consulting please visit my business website at