Sign In  |  Register
 
 DotNetNuke Powered!
DotNetNuke Support Forums

How To: Add Google Analytics to DotNetNuke

Rate this topic:

Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

AuthorMessages
John Mitchell
Posts:2767



06/10/2007 10:54 AM  

How to add Google Analytics to DotNetNuke

You 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. 

DavidWSnow
Posts:162



12/16/2007 9:10 PM  

There seems to be a curious side effect of doing Google Analytics this way. I chose it because the Text/HTML is one of the ones that is xhtml compliant and I was trying to make as many of many pages compliant as possible. In this method you don't want to have any text in the module. When you do this the empty module fails W3C validation by complaining about "Align=left" not being valid in this context. The free Google Analytic's module I tried also had this problem.

Finally I did what I had being trying to avoid and stuffed the code in my skin.

Also when I have used "place module on every page" I have had a very hard time removing them when I changed my mind. Does one have to remember which module is the original module they started with, or is ther some other "magic"?

/DaveS

Declic Video
Posts:49



05/11/2008 12:56 PM  
Hello,

Could you please give the trick to install the "Google Analytics" in the skin ?
Is it a good idea or not ?

DV FX
John Mitchell
Posts:2767



05/11/2008 1:02 PM  
Sure, you can add Google Analytics to the bottom of your skin.

It's probably better than putting it in a module that displays on all pages.
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

Forums >DotNetNuke Support >Frequently-Asked-Questions > How To: Add Google Analytics to DotNetNuke



ActiveForums 3.7
Visit our Store for great DotNetNuke Modules and Skins
DNNMasters Sitemap/Google Sitemap 3.0

Item codeSM3-01
Price$29.00
Product Information 
DotNetNuke CSS NavMenu 3.3 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
Snapsis PageBlaster 3.3.1 for DotNetNuke - Professional Edition

AuthorJohn Mitchell
Base Price$79.00
Product Information 
XDAkuna (Web 2.0 CSS XHTML Skin)

Item codeXDAkuna
AuthorNina Meiers
Price$49.00
Product Information