This library overrides or extendes behaviors from DNN analytics providers such as the Google Analytics provider.
The class GoogleAnalyticsEngineWithRoles
inherits the GoogleAnalyticsEngine
class from the DotNetNuke library, to allow to exclude traffic from users that are in specific roles. Since the current implementation only allows to exclude traffic from Administrators, this extension allows to also exclude for other non-admin users. This is useful when you don't want to track traffic from your internal company users, but want to do it for the rest of the users.
- Download the .zip file from the releases section
- Unzip the file and drop it to the \bin folder of your DNN installation
- Setup your Google Analytics connector through the DNN user interface
- Edit the \Portals\0\GoogleAnalytics.config file ("0" is the ID of your portal) and add this setting, with the roles you want to exclude comma separated (i.e. "My Role 1,My Role 2")
<?xml version="1.0" encoding="utf-8"?>
<AnalyticsConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Settings>
...
<AnalyticsSetting>
<SettingName>OtherUntrackedRoles</SettingName>
<SettingValue>My Role 1,My Role 2</SettingValue>
</AnalyticsSetting>
</Settings>
</AnalyticsConfig>
- Edit the \SiteAnalytics.config and replace the engine type with this value:
<EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngineWithRoles, DotNetNuke.Services.Analytics</EngineType>
- If you update the Google Analytics connector settings through the DNN user interface, you need to manually add again the
OtherUntrackedRoles
setting by repeating the step #4 mentioned above