Manually tracking a url


#1

Hi all,

My question: Is there a way of manually registering a url ‘hit’? I am using trackPageView but that only seems to pass page title not the url.

Background: Been using Piwik in development for a few months yet probably not as god intended. My main interaction with it is in doing an sql query to pull the most popular urls into php, then sort and ranking them from there. Works great. My problem is that when using trackPageView for on-page links it passes the variable not as a url but as a page title (piwik_log_action, Type 4) which I have specified Piwik not track (as i cant do anything with them).

Any help greatly appreciated.


#2

Ah I sorted it, solution is to use ‘trackLink’ like:


_paq.push(['trackLink', url, 'link']);

I had tried this before but it didnt work because i format all my urls to begin with ‘//’ so that the protocol is specified by the user not by me (http/https), this however seems to be the reason the url was not showing up in my query. Prepending the url with ‘http:’ made it come up in my search.


(Matthieu Aubry) #3

Yes Piwik checks for valid URLs and I think our check will fail URLs looking like //host/etc.

I think this may be a bug, so you’re welcome to create a ticket on our issue tracker: http://dev.piwik.org/