Johny
October 30, 2012, 5:01pm
#1
Hi,
I have an ajax based search engine, which displays results after making ajax call.
During every search ajax call i call
function search(keyword) {
…do ajax searc …
piwikTracker.trackSiteSearch(keyword);
}
I have also added following to my template file (generic) footer just before
Problem is that piwikTracker.trackSiteSearch is not logging keyword into analystics
On the other hand if i load my webiste mydomain.com/search?q=keyword this gets logged as i have enabled search loggin in piwik.
But custom logging is not going through.
Console.log(piwikTracker) in search function shows piwikTracker structure.
Using piwik 1.9.1
Any suggestion how to debug or fix this.
Thanks
Johny
October 30, 2012, 7:05pm
#3
Am i missing something.
How can i enable debug on the site where i have added teh javascript code to check whats failing
matthieu
(Matthieu Aubry)
October 30, 2012, 7:14pm
#4
Maybe you are calling the trackSiteSearch too early, before piwikTracker was created?
I would recommend to use the asynchronous version: http://piwik.org/docs/javascript-tracking/#toc-asynchronous-tracking
we are going to migrate all docs and piwik UI to use async which solves this problem
Johny
October 30, 2012, 7:58pm
#5
Thanks Matt,
i checked httpd log on website where piwik is hosted and found that its getting the hit
“GET /piwik.php?search=tiger&search_count=false&idsite=1&rec=1&r=449196&h=1&m=20&s=57&url=http%3A%2F%2Fwww.mydomain.com %2Fsearch%3Fquery%3Dlion&_id=25ddc93b09aa14f5&_idts=1351610242&_idvc=3&_idn=0&_refts=0&_viewts=1351620981&pdf=0&qt=1&realp=0&wma=1&dir=0&fla=1&java=1&gears=0&ag=0&cookie=1&res=1280x800 HTTP/1.1” 200 43 “http://www.mydomain.com/search?query=lion ” “Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0”
replaced domain name with mydomain
I loaded my website mydomain.com/search?query=lion
then made an ajax search for tiger, which showed up in the httplog of piwik server.
But its not seen in the analytics report. What could be missing here ?
matthieu
(Matthieu Aubry)
October 30, 2012, 9:20pm
#6
OK the request looks good. So maybe data is recorded. Do yo not see it in Visitors > Visitor Log for “today” ?
If not, enable debugging: http://piwik.org/docs/tracking-api/reference/#toc-debugging-the-tracking-api-requests
and you wlil see any error message
Johny
October 31, 2012, 4:20am
#7
i checked visitor log and came to realization that since the post received containted the url which is like mydomain.com/search?query=lion as given below, Piwik registers search keyword from the url and there by doesnot register the value given by search=xxxx Looks like a bug, can we disable the url being sent in this scenario.
“GET /piwik.php?search=tiger&search_count=false&idsite=1&rec=1&r=449196&h=1&m=20&s=57&url=http%3A%2F%2Fwww.mydomain.com %2Fsearch%3Fquery%3Dlion&_id=25ddc93b09aa14f5&_idts=1351610242&_idvc=3&_idn=0&_refts=0&_viewts=1351620981&pdf=0&qt=1&realp=0&wma=1&dir=0&fla=1&java=1&gears=0&ag=0&cookie=1&res=1280x800 HTTP/1.1” 200 43 “http://www.mydomain.com/search?query=lion ” “Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0”
So in my case visitor log registers lion multiple times but never registers tiger or anyother search keyword given.
Johny
October 31, 2012, 7:21pm
#8
I think its a bug in code…
Matt: Can you look into this plz
matthieu
(Matthieu Aubry)
October 31, 2012, 8:09pm
#9
Johny
November 1, 2012, 4:17am
#10
Thanks, it works.
Other bug is in Site Search Keyword widget on dashboard. When we click on the “Next” to see next set of keywords, it says There is no data for this report and then shows 1 to 10 of Nan, which was previously showing 1 to 10 of 15
Though the Action -> Site Search - Keywords widget shows keywords from 10-15 on clicking Next, but then pagination shows up as 1 to 10 of NaN.
matthieu
(Matthieu Aubry)
November 1, 2012, 9:14am
#11
ok please upgrade to 1.9.2-b3 which fixes this issue: http://builds.piwik.org/piwik-1.9.2-b3.zip
Johny
November 1, 2012, 4:44pm
#12
Thanks Matt
You are very helpfull and very quick.
One more question, where can I find more themes