In Site Analytics Pro provides reporting and charts from Google Analytics in your mojoPortal site and for supported databases also provides long term storage of analytics data. Google only promises to keep analytics data for up to 2 years, in practice it seems they keep it for about 3.5 years, so harvesting the data allows you to keep historic data that would otherwise be lost over time. While In Site Analytics Pro is ideal for tracking the traffic of your mojoPortal site because it integrates with mojoPortal and allows you to have traffic reports integrated in your site, it can be used to track any one of your Google Analytics Profiles, it does not have to track a mojoPortal site, but it does need to be installed in a mojoPortal site. you could for example setup a mojoPortal site with In Site Analytics Pro and use it to track the traffic of one of your other non-mojoPortal sites. While this would not provide reports integrated into your non-mojoPortal site, you would still get the benefit of long term data storage.
The charts and reports can work directly from the Google Analytics Data API or from the database. Only MS SQL 2005/2008/SqlAzure and MySql are supported for data capture, but installations of mojoPortal using other database platforms can still use the charts and reports directly from the API. It is also possible and preferable to use a separate database for the analytics data instead of keeping it in the same database as the site. It can be a large amount of data over time, much larger than the actual site data. You could also use any database platform for the site but still use MS SQL or MySql for In Site Analytics, it just requires you to manually run the database script(s) and change one configuration setting, see the System Requirements/Installation tab for more details.
The main charts and reporting plugs into the Administration menu and is protected by roles, but there are also 2 features that plug into the mojoPortal content system to allow you to publish a traffic chart and/or visitor map on public pages of your site as I have done on our Community page.
Below are some screen shots of the main features, you can also try it out live on demo.mojoportal.com, just login as firstname.lastname@example.org with the password admin, then click the Administration Link, the click Site Traffic Reports from the Administration menu.
Note that the map can be re-sized by dragging the bottom right corner.
Note that while In Site Analytics Pro does not use the main site skins, it is skinnable, and we include 2 skins and you can also create your own by copying and modifying one of the existing ones. You can set the skin from configuration settings. From the skin you can control the JQueryUI theme as well as colors of the charts and other style elements.
Requires mojoPortal 184.108.40.206 or higher, make sure you are running a compatible version of mojoPortal before you install. You can find your mojoPortal version at Administration > System Information in your site.
Requires a free Google Analytics account and requires that you are tracking traffic data using Google analytics. See the documentation about enabling google analytics tracking in mojoPortal.
For data capture, requires MS SQL 2005/2008/SqlAzure or MySql, but reports from the Google Analytics Data API can work even if you do not have a supported database, it just means that without a supported database the data can not be captured for long term storage.
After unzipping the package for In Site analytics Pro, you will find that we have versions included for both .NET 3.5 and .NET 4.0. If you are running a .NET 4.0 version of mojoPortal then you use the files from dotnet40/wwwroot, whereas if you are running a 3.5 .NET version of mojoPortal you would use the files from the dotnet35/wwwroot folder.
Since the data about your site traffic can be a very large amount of data, it is preferable to use a separate database instead of storing the data in the same database as your site. To do this you should create a new database before you install In Site Analytics Pro and add a connection string to your user.config file as indicated below:
If using MS SQL 2005/2008/SqlAzure, use this format:
<add key="sts_analytics_ConnectionString" value="server=localhost\SQLExpress;UID=youruser;PWD=yourpassword;database=yourdbname" />
If you are using MySql then use this format:
<add key="sts_analytics_ConnectionString" value="Server=localhost;Database=yourdbname;Uid=yourdbuser;Pwd=yourdbpassword;Charset=utf8;" />
It is important to add this before you begin the installation otherwise it will install it into the same database as your site. Note that changes in Web.config are automatically detected by the ASP.NET runtime, but changes in user.config are not, so after making changes in user.config it is best to touch Web.config (type a space in it and save it) to make it reload settings.
The files are pre-configured for use with MS SQL 2005/2008/SqlAzure, so if you are going to use MySql, then you need to copy the sts.Analytics.Data.dll file from DataLayers/mysql folder into the wwwroot/bin folder of the package before you install it in your mojoPortal site.
Copy the contents of the wwwroot folder (the contents not the folder itself) into the root of your mojoPortal site and the files will all land in the correct places. Then visit yoursiteroot/Setup/Default.aspx to complete the installation.
After installation, a new menu item will appear in the Administration Menu for "Site Traffic Reports". In addition to the main reporting features that plug into the administration section, there are also 2 features that plug into the Content Management System and will show up in the list of features you can add to a page as "In Site Traffic Chart" and "In Site Visitor Map". If you don't want other users who can edit pages to be able to add these features to any pages, then you should limit them to the Administrators or Content Administrators roles. Any Content System feature in mojoPortal can be limited to use by specific roles, go to Administration > Advanced Tools Feature Installation and look for the permissions link next to each feature name. From there you can set roles allowed to use the feature.
Before you can use any of the features of In Site Analytics Pro, you must configure a Google analytics Account to track. When you click the link for Site Traffic Reports you will see a menu item for "Analytics Account Settings". You will need to enter the email address and password used for your Google Analytics Account, then click next and you will see the list of profiles, where you can choose which profile you want to track, then click Finish. After that you can also specify what site roles you would like to be able to view the traffic reports and also which roles are allowed to save or edit API query definitions (only available if using a supported database).
Once the profile is specified all the reports that use API data will now be enabled, if you are using a supported database then you will also see a link for "Data Manager" where you will find a button to synchronize the data from the google analytics data API into the database. When you click the button you will see a progress bar and it is best to keep this page open until it finishes capturing the data. Once you have done an initial data capture, you can also configure it to automatically run the synchronization whenever the application restarts (which typically happens at least once per day).
Configuring Automatic Data Synchronization
In user.config add this setting <add key="stsAnalytics:AutoSyncSiteGuid" value="caec417e-52ee-45e7-b018-5dea70611393" />, but replace the value with the SiteGuid for your site. you can either get this from the database in the mp_Sites table, or you can enable it to be shown in the Administration > SiteSettings page by adding this to your user.config:
<add key="ShowSiteGuidInSiteSettings" value="true" />
In Web.config you will need to add an entry for an HttpModule. If using IIS 7.x Web Server with Integrated Pipeline mode then the module goes in the <system.webServer><modules> section. Actually it is already there in mojoPortal 220.127.116.11 but it is commented out so you just need to un-comment it:
<add name="stsAnalyticsDataSync" type="sts.Analytics.UI.AnalyticsDataSyncHttpModule, sts.Analytics.UI" preCondition="managedHandler"/>
If you are using IIS 6.x or IIS 7.x with a "Classic" application pool then the module needs to be decalred in the <system.web><httpModules> section like this:
<add name="stsAnalyticsDataSync" type="sts.Analytics.UI.AnalyticsDataSyncHttpModule, sts.Analytics.UI" />
Considerations for Multi Site Installations
mojoPortal can host multiple sites in a single installation, but by default In Site Analytics is only enabled for the first site that is the server administration site (ie child site can only be created from this site). You can enable In Site Analytics Pro in child sites but there are a few things you should consider before deciding to do so.
If you capture all the data for multiple profiles in the database, due to the sheer volume of data that can result from high traffic sites, query performance of database driven charts and reports can degrade over time. If you are capturing all the possible data it is best to only capture it for a single google analytics profile. You can limit what data is captured by some configuration settings or you can disable database access in child sites and limit it to only capturing data from the main site profile into the database. In this case child sites can still use the reports with data from the Google Analytics Data API but only the main site benefits from long term data storage. The following scenarios are recommended ways of configuring In Site Analytics Pro data capture.
Only Capture Complete Database Data for 1 Profile, but allow child sites to use the API Data
This allows the main site to capture all available data for long term storage and you can toggle between Database Data and Live API Data in the reports and charts. The API Data is always more up to date and reports may run faster than using the Database in some cases, but the data for all reports is captured into the database so that over time the database reports will be more complete than the API reports. In order to make sure the database data is correct, we have to wait a few days after google has captured and processed the data for a given day before we capture it into the database, otherwise we might get partial data for the day, so the database data is always a few days behind the API data. The API data is always up to and including the current day's traffic, but of course the current day's traffic is changing throughout the day. For this configuration you should add these settings to your user.config file:
<add key="stsAnalytics:AllowUsingDatabaseInChildSites" value="false" />
<add key="stsAnalytics:AllowQueryEditingInChildSites" value="false" />
<add key="stsAnalytics:Tracking1ProfileOnly" value="false" />
Capture Minimal Data in the Database but allow Child Sites to Also Capture Data
Really some data is more important to keep for the long term than other data. For example the main traffic chart on the Dashboard which shows traffic by Month is the main report where it is very desirable to keep long term data because we would like to be able to see the long term trend far beyond the amount of time that Google keeps the data. The amount of data needed for this chart is not as large as some of the other data captured and therefore could be captured for multiple sites/analytics profiles without impacting performance of the reports. The rest of the data has some value in keeping it for long term but the most actionable data is probably data within the last 2 years anyway and the amount of storage needed for that data is quite large over time. So in this configuration we would disable database storage except for the data needed for the traffic chart by adding the following settings to user.config:
<add key="stsAnalytics:AllowUsingDatabaseInChildSites" value="true" />
<add key="stsAnalytics:AllowQueryEditingInChildSites" value="true" />
<add key="stsAnalytics:Tracking1ProfileOnly" value="false" />
<add key="stsAnalytics:SyncPages" value="false" />
<add key="stsAnalytics:SyncCountryData" value="false" />
<add key="stsAnalytics:SyncBrowser" value="false" />
<add key="stsAnalytics:SyncExternaSearch" value="false" />
<add key="stsAnalytics:SyncReferringSites" value="false" />
To add the "Site Traffic Reports" link to the Administration menu in child sites you should copy the file /Data/Sites/1/supplementaladminmenulinks/00001sts-analytics-adminlinks.config into the folder at /Setup/initialcontent/supplementaladminmenulinks
Disable In Site Analytics Pro Completely in Child Sites
This setting can completely disable In Site Analytics Pro in child sites:
<add key="stsAnalytics:AllowReportsInChildSites" value="true" />
A Few Other Configuration Settings of Interest
While In Site Analytics Pro doe snot use the same skinning system as the rest of mojoPortal, it is skinnable and we include 2 skins located under the App_Themes folder named Analytics1 and Analytics2, you can copy one of these and modify it and you can specify which skin to use with this setting:
<add key="stsAnalytics:Theme" value="Analytics1" />
You can control the default width and height of the Visitor Map report with these settings:
<add key="stsAnalytics:VisitorMapHeight" value="700" />
<add key="stsAnalytics:VisitorMapWidth" value="1000" />
Mixing Database Platforms
Since you can use a separate database for the analytics data it is possible to use a supported database platform for In Site Analytics Pro even if your site is running under one of the databases supported by mojoPortal but not supported by In Site Analytics Pro, such as SQL CE, PostgreSQL, Firebird or SQLite. As long as you have a MS SQL or MySql database available to your site, you can install the files the same as instructions above, but you will need to run the database script(s) for In Site Analytics Pro manually in your database. The script files are located under /Setup/applications/sts-analytics/SchemaInstallScripts/[databaseplatform]
You would also need to add this setting to user.config:
<add key="stsAnalytics:AssumeDatabaseIsSupported" value="true" />