How to add Google Analytics to DotNetNukeYou could also use this same method to add any javascript code into your pages. The reason for using the Footer field of the module is because you will not have any problems with the rich text editor mangling your javascript code. 1. Add an HTML/Text module to your home page and adjust it's position so that it is as close to the bottom of the page as possible.
Note: Google tells you to put their code at the very bottom of the page before the closing body tag. They only say this so that their script will be the last to load and that way it won't get messed up by other scripts that may be loaded. Putting the code as close to the bottom of the page as possible will still work.
2.Go to Module Settings on the action menu for that module. 
3. Set Permissions for "All Users" to be able to view the module. 
4. Expand the Advanced Settings and check "Display on all pages", then paste your Google Analytics code into the Footer field. 
5. Expand Page Settings and Uncheck "Display Container" and "Allow Print". Then Set the Cache Time to a large value since this will probably never change. 
Now click on update and your Analytics code will be put on every "Normal" page that is visible to all users. The reason I say "Normal page" is because using this method will not output the analytics for any administrative pages. |