Coder Social home page Coder Social logo

dnncommunity / dnn.webanalytics Goto Github PK

View Code? Open in Web Editor NEW
10.0 17.0 11.0 858 KB

A Dnn (formerly DotNetNuke) module for capturing information about visitors. Includes a report UX and a map UX to show location information.

Home Page: http://dnncommunity.org/Community/Website-Metrics

C# 14.20% ASP 0.32% TSQL 2.05% JavaScript 81.69% HTML 1.74%
dnn dnncms dnnplatform dotnetnuke webanalytics hacktoberfest

dnn.webanalytics's Introduction

Dnn.WebAnalytics

A Dnn module for capturing information about visitors. Includes a report UX and a map UX to show location information.

dnn.webanalytics's People

Contributors

skamphuis avatar tychodewaard avatar valadas avatar x3technology avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dnn.webanalytics's Issues

Installation process

This module requires several large data files to be located in the App_Data folder and also a .config file to be located in the web root. The data files are much too large for the module installer process. And, anyways I am not sure how to work them into the module manifest.

Here are files that need to be located in the App_Data folder:
51Degrees.dat - provides device information for requests made to the website
GeoIP2-City.mmdb - provides geocoding service for IP addresses

This file needs to be the web root:
51Degrees.mobi.config

Localization

Would be nice if the module could be localized.

Could not load file or assembly 'Dnn.WebAnalyticsLinqToSql' or one of its dependencies

I installed Dnn.WebAnalytics and I get the following log event whenever the VisitorJob is run.

THREAD ID:13
TYPE:Dnn.WebAnalyticsLinqToSql.VisitorJob, Dnn.WebAnalyticsLinqToSql
EXCEPTION:Could not load file or assembly 'Dnn.WebAnalyticsLinqToSql' or one of its dependencies. The system cannot find the file specified.
RESCHEDULED FOR:5/4/2021 8:54:20 PM
SOURCE:STARTED_FROM_SCHEDULE_CHANGE
ACTIVE THREADS:0
FREE THREADS:1
READER TIMEOUTS:0
WRITER TIMEOUTS:0
IN PROGRESS:0
IN QUEUE:9

and

AbsoluteURL:
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:52701eeb-178f-47b2-bc0c-03d2a4bcca77
AssemblyVersion:
PortalId:-1
UserId:-1
TabId:-1
RawUrl:
Referrer:
UserAgent:
ExceptionHash:s0nVKrlgDULPGdBb7Zi3l+WpHj4=
Message:Could not load file or assembly 'Dnn.WebAnalyticsLinqToSql' or one of its dependencies. The system cannot find the file specified.
StackTrace:
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
   at System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)
   at DotNetNuke.Services.Scheduling.ProcessGroup.GetSchedulerClient(IServiceProvider services, String strProcess, ScheduleHistoryItem objScheduleHistoryItem)
   at DotNetNuke.Services.Scheduling.ProcessGroup.Run(ScheduleHistoryItem objScheduleHistoryItem)
InnerMessage:
InnerStackTrace:
Source:mscorlib
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:

The IIS and SQL Server are running on different machines and both are running Windows Server 2019.

I tried checking this repo and can't seem to find anything about Dnn.WebAnalyticsLinqToSql except the install and uninstall scripts.

DNN8 Compatibility

I know DNN 8 is old and everything, but still I'd love it if the module woudl support DNN8. As far as I can see, the only thing that's keeping it from working, is the API-urls being different in 9.

No Indexes Exist

The DB tables need to be reviewed for the most common queries and requisite indexes need to be added to the tables.

Table names not following naming convention

There are other tables that are used for the community modules and they're prefixed with Community_. This update proposes that the tables in this module are updated to match that naming convention.

I already have the SQL done and ready, but I can't update the code itself until a previous pull request is merged (after review).

/*
	Remove constraints
*/

IF EXISTS (SELECT 1 
    FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS 
    WHERE CONSTRAINT_NAME = N'FK_{objectQualifier}Visits_Visitors' 
    AND TABLE_NAME = N'{objectQualifier}Visits')
    ALTER TABLE {databaseOwner}[{objectQualifier}Visits] DROP CONSTRAINT [FK_{objectQualifier}Visits_Visitors];
GO
	
IF EXISTS (SELECT 1 
    FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS 
    WHERE CONSTRAINT_NAME = N'FK_{objectQualifier}Visits_Tabs' 
    AND TABLE_NAME = N'{objectQualifier}Visits')
    ALTER TABLE {databaseOwner}[{objectQualifier}Visits] DROP CONSTRAINT [FK_{objectQualifier}Visits_Tabs];
GO

IF EXISTS (SELECT 1 
    FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS 
    WHERE CONSTRAINT_NAME = N'FK_{objectQualifier}Visitors_Users' 
    AND TABLE_NAME = N'{objectQualifier}Visitors')
    ALTER TABLE {databaseOwner}[{objectQualifier}Visitors] DROP CONSTRAINT [FK_{objectQualifier}Visitors_Users];
GO

IF EXISTS (SELECT 1 
    FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS 
    WHERE CONSTRAINT_NAME = N'FK_{objectQualifier}Visitors_Portals' 
    AND TABLE_NAME = N'{objectQualifier}Visitors')
    ALTER TABLE {databaseOwner}[{objectQualifier}Visitors] DROP CONSTRAINT [FK_{objectQualifier}Visitors_Portals];
GO

/*
	Rename community tables to prevent conflicts and group the data together
*/

sp_rename N'{objectQualifier}Visitors', N'{objectQualifier}Community_Visitors';
GO

sp_rename N'{objectQualifier}Visits', N'{objectQualifier}Community_Visits';
GO

/*
	Add constraints back
*/

ALTER TABLE {databaseOwner}[{objectQualifier}Community_Visitors]  WITH CHECK ADD  CONSTRAINT [FK_{objectQualifier}Community_Visitors_Portals] FOREIGN KEY([portal_id])
	REFERENCES {databaseOwner}[{objectQualifier}Portals] ([PortalID])
	ON DELETE CASCADE;
GO

ALTER TABLE {databaseOwner}[{objectQualifier}Community_Visitors] CHECK CONSTRAINT [FK_{objectQualifier}Community_Visitors_Portals];
GO

ALTER TABLE {databaseOwner}[{objectQualifier}Community_Visitors]  WITH CHECK ADD  CONSTRAINT [FK_{objectQualifier}Community_Visitors_Users] FOREIGN KEY([user_id])
	REFERENCES {databaseOwner}[{objectQualifier}Users] ([UserID])
	ON UPDATE CASCADE 
	ON DELETE CASCADE;
GO

ALTER TABLE {databaseOwner}[{objectQualifier}Community_Visitors] CHECK CONSTRAINT [FK_{objectQualifier}Community_Visitors_Users];
GO

ALTER TABLE {databaseOwner}[{objectQualifier}Community_Visits]  WITH CHECK ADD  CONSTRAINT [FK_{objectQualifier}Community_Visits_Tabs] FOREIGN KEY([tab_id])
	REFERENCES {databaseOwner}[{objectQualifier}Tabs] ([TabID]);
GO

ALTER TABLE {databaseOwner}[{objectQualifier}Community_Visits] CHECK CONSTRAINT [FK_{objectQualifier}Community_Visits_Tabs];
GO

ALTER TABLE {databaseOwner}[{objectQualifier}Community_Visits]  WITH CHECK ADD  CONSTRAINT [FK_{objectQualifier}Community_Visits_Visitors] FOREIGN KEY([visitor_id])
	REFERENCES {databaseOwner}[{objectQualifier}Community_Visitors] ([id])
	ON DELETE CASCADE;
GO

ALTER TABLE {databaseOwner}[{objectQualifier}Community_Visits] CHECK CONSTRAINT [FK_{objectQualifier}Community_Visits_Visitors];
GO

Module is not Azure Friendly

If we were to install this module in Azure, it would not work. The SQL and CS files need to be updated to support Azure, should we ever move the website there. (or anyone use this there...)

The SQL statements were missing DNN tokens as well.

In order to perform these updates and ensure they build properly, the following needs to be done as well:

  • Update project to use any IIS configuration (website path/URL)
  • Update references to not assume the website folder is there and that the dependent DLL's will be present.

Fix bottom reports

Data in bottom report is reflecting changes to the date range selectors at the top.

Foreign key constraint blocks (final) tab deletion

When trying to delete a page from the trash bin I run into an error that tells me to check my internet connection... As that can't be the reason I investigated a bit and found out that there is a foreign key constraint in the table Community_Visits (FK_Community_Visits_Tabs) blocking the deletion.

When deleting all records in this table with tab_id = (TabId of this page from the Tabs table) and restarting the app pool, the page can be deleted from the trash bin.

It is in fact done from the wrong side (should be from the master = Tabs table to the Community Visits table with the ON DELETE CASCADE option - but this is a change to the core system, and therefore not a good practice for modules).

The constraint should be removed, and to keep that table "clean" a task could check from time to time if all values of the tab_id column exist in the Tabs table and delete these records if not.

Object Qualifier not supported

I installed version 1.1.2 on a portal that uses an object qualifier (which is a heritage from long time ago). When placing the module on a page, I get an HTTP error 500 in the request /api/Dnn.WebAnalytics/visit?...

Answer is:
{"Errors":[{"source":".Net SqlClient Data Provider","number":208,"state":1,"errorClass":16,"server":"XXX","message":"Invalid object name 'dbo.Community_Visits'.", ...

The name of the table is something like dbo.xxx_Community_Visits, but I could not find the wrong line of code tbh.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.