Login to download the latest version of Mint and your favorite Pepper, purchase additional licenses, or post in the Forum. Don't have an account? Create one!

In Partnership with Media Temple

Mint Forum

Add most popular pages to my website itself

Is there a way I can grab a list of the most popular pages on my site from Mint, from my website itself? I can use PHP or JS or curl, whatever – the issue isn’t that I am asking for code as much as I am just wondering what API there is for that.

Thanks!

Till
Third-Party Pepper Developer
Posted on May 30, '09 at 04:07 am

Just fetch your desired result from your mint_visit table.

SELECT resource, resource_checksum, resource_title, COUNT(resource_checksum) AS total, dt FROM mint_visit GROUP BY resource_checksum ORDER BY total DESC, dt DESC LIMIT 0, 10

Shaun Inman
Mint/Pepper Developer
Posted on Jun 01, '09 at 10:18 am

Since Mint’s database is optimized for recording data and not retrieving it (because hopefully more people check your site than you check your stats) you should probably cache the results of Till’s query (refreshing it at regular intervals) and serve the cached data to visitors to prevent throttling your Mint database.

And obviously I could then constrain the date, should I so desire, with SQL.

Thanks for the advice, Till and Shaun.

You must be logged in to reply. Login above or create an account