Blogs

Identifying Popular Links Portal Wide

06 Jun

After having my DNN sites up and running for almost a year I was very curious to see exactly how many clicks I had on the various tracked links.  I started to look around and was getting tired of clicking "Edit:" on each link to view the information.  So I created this simple query to quickly pull the links in the "Most clicked" order. 

This is a very primitive query that gets the module name, link, click count and last click time.  For documents loaded in the documents module you will only get the file id of the file, but it at least helps to illustrate the activity.

SELECT m.ModuleTitle, t.url, t.Clicks, t.LastClick
FROM URLTracking t
    
INNER JOIN Modules m
        
ON (t.ModuleId m.ModuleID)
WHERE t.PortalId 0
    
AND TrackClicks 1
ORDER BY t.Clicks DESC

You will need to edit the PortalId portion of the where clause to ensure that you reference the correct portal.

tags: DNN, SQL
comments powered by Disqus

Content provided in this blog is provided "AS-IS" and the information should be used at your own discretion.  The thoughts and opinions expressed are the personal thoughts of Mitchel Sellers and do not reflect the opinions of his employer.

Connect with Mitchel

I hope the information here has been helpful. To stay connected you can also subscribe to blog updates via email, contact Mitchel about consulting services, or reach out for assistance via CodeMendor

Content Copyright

Content in this blog is copyright protected.  Re-publishing on other websites is allowed as long as proper credit and backlink to the article is provided.  Any other re-publishing or distribution of this content is prohibited without written permission from Mitchel Sellers.