: How can I obtain click data to sort a list of URLs? If you had a list of URLs and you wanted to show which of them was more important than the others (by click-through), how would you
If you had a list of URLs and you wanted to show which of them was more important than the others (by click-through), how would you gain the number of clicks for a given link so that you could sort them, possibly showing that some links are a thousand times more visited than the others?
The output could be:
1 : link1 : 10500
2 : link2 : 9200
3 : link3 : 8100
4 : link4 : 7000
5 : link5 : 250
6 : link6 : 100
7 : link7 : 20
More posts by @Murphy175
2 Comments
Sorted by latest first Latest Oldest Best
Consider using a URL shortening service such as bit.ly to get click data about a list of links. Here's how it would work:
You'd use bit.ly shortened links for all links in your list.
When a visitor clicks a bit.ly link, bit.ly increments the click count and stores it on their server.
When a user visits your page – but before the list is displayed to them – your script would determine how many clicks each link has received using the /v3/clicks/ method from the bit.ly REST API, which returns click data about multiple bit.ly links you supply.
You would sort this information by the total number of clicks, display the list, and optionally show the number of clicks for each link.
You may also choose to cache the results of this request in your database and only request new data once an hour/day.
Well, after your comment, my opinion is that you should use Google Analytics. Using that tool, you are able to avoid any database and all the resource and space that this will require because of the large amount of data to track. Besides they surely can track info better than a single programmer can do. Finally, using Google Analytics you'll be able to order your pages by visit (DESC or ASC).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.