Wednesday, November 28, 2007

Using Google Analytics with DotNetNuke (DNN)

I use a content management system called DotNetNuke to build a lot of my websites. It's tremendous in its flexibility and power, and {gasp} it's an open source project for the Microsoft platform. I've used other CMS tools, but nothing comes close to the power of DotNetNuke, especially when extending it using ASP.NET.

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.
So what to do? The answer is simpler than it seems.
  1. Login as either the DNN administrator or super user (host) account.
  2. Navigate to your home page
  3. Add a Text/HTML Module, preferable somewhere unobtrusive like the bottom of the page
  4. 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.
  5. Next, click the 'Edit Text' button on the module
  6. 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.
  7. 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'
  8. 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).
Make sure that Google Analytics is picking up the code, and if so, you'll have to wait until the next day to view your stats through the Analytics reports. Google updates the stats everyday at about midnight Pacific time, so statistics are never real time and always one day behind, but they are a great tool to have.

Happy stats!

Sunday, November 18, 2007

How to add multiple sites with the same root directory to your MSN Webmaster tools

Some may not even know that MSN has a set of webmaster tools to track your websites' position in the search engine. For those who don't yet know about the tools, you can find them at They are a far cry from the robust tools available from Google, but they're a good start. I track only my most important websites in the MSN tools (at least for now).

One problem I ran into was in the verification process. MSN requires you to either add an XML file to the root directory of your site, or add a META tag to your home page HTML file.

I use a Content Management System that allows me to build hundreds of web pages using the same database, file structure, and index file. Each page is built dynamically at run time based on the request from the user (what URL, which page, etc.).

This left me with a problem - I could add a new META tag to my default HTML file for each site that I track, or I could add the XML file to the root directory. Since hundreds of websites share the same default HTML file, it seemed inefficient to add the overhead for thousands of requests per hour to that file. Instead, I added the XML file to the root directory.

Here's where it got tricky. The file name is always the same for each website (LiveSearchSiteAuth.xml), but the content is different. It's a fairly simple XML file with a single Users attribute with multiple users nested with user tags. The first site I added was easy; I simply copied and pasted the text it gave me into the XML file and copied that into the root directory of the site.

The rest were a bit harder, but once I had it figured out, they were also easy. Instead of copying all the XML code that Microsoft gives you, only copy the information between the start and end users tags and add it onto the end of the file you created. You can add as many users tags as you would like - one for each website you want to track.

I don't think there's a limit - I have over 10 right now, and I assume that I can add as many as I'd like to the file.

Thursday, November 8, 2007

Google stock takes a tumble

The Associated Press is reporting that Google's stock dropped about 5% today. The tumble means a loss of about $12 billion in market capitalization. Other tech stocks also took large plunges today, with Apple down about 6% ($9 billion drop in market cap) and Cisco fell nearly 9.5%, costing its shareholders about $19 billion in market value.

The correction in Google's stock price shouldn't come as a surprise - no stock goes up all the time. But, the timing is odd, and reflects investor's ignorance of technology in general and tech companies in particular. The drop came about because of a warning from Cisco that demand is down (and partially blaming it on the real estate/mortgage industry woes). I guess that investors lump all technology stocks in together, but Cisco and Google couldn't be more different, and investors really don't understand the difference between a HARDWARE (Cisco) and a SOFTWARE/ADVERTISING (Google) company. The fact that investor's panicked and started dumping tech stocks shows a problem with how American's invest - i.e., they don't do enough research into the companies in which they invest.

(sidenote: Americans should be far more worried about the Dollar's continuing weakness, especially with rumors of China threatening to dump Dollars in favor of the Euro.)

Google is still on an upward track, with huge earnings and enormous growth potential. The ceiling for Google is still nowhere in sight, so while new investors might not be getting in on the ground floor, those savvy enough to do so might hop on now. Expect a bounce back for Google's stock soon.

Wednesday, November 7, 2007

MSN's search engine really sucks

The title speaks for itself, and although MSN won my most recent relevancy test competition, something is completely backwards about the search engine. When I say that it sucks, I'm speaking strictly as a frustrated webmaster and SEOer.

Complaint #1: I have sites ranked in the top 3 in both Google and Yahoo while MSN doesn't even recognize the site. Tens of thousands of backlinks, thousands of pages, a high level of authority, and MSN doesn't have the site in it's index yet? Something's wrong here.

Complaint #2: I can create a new website with a domain name of, and be ranked in the top 5 in less than a week. Why should domain name have that much weight?

Memo to the engineers: bring your search algorithm into the 21st century, because honestly, it's awful.

Just my 2 cents.