View Full Version : Not seeing download stats
nbmalvern
03-20-2008, 04:30 AM
I see visits to my download page, but no download stats. The download table, including the links, is generated by Javascript from an xml file. Do I need to add code to get the download stats?
http://www.nbmalvern.org
Car Guy
03-20-2008, 04:49 AM
Hi
Only html links with register as download, no javascript.
Richard
nbmalvern
03-20-2008, 05:13 AM
Hi
Only html links with register as download, no javascript.
Richard
This is html code generated by javascript. Do I need to generate StatCounter code as well?
webado
03-20-2008, 01:14 PM
The Statcounter that sits on your page will register a left click on a link to a file that is to get downloaded - provided that is an html link.
If you don't have an actual html link there it cannot be tracked. Html code written from javascript won't get detected.
I looked at your pages and for starters I see you are using iframes handled through javascript.
I see you used Statcounter on the actual pages inserted in those iframes - that's fine. But beyond that whatever you are building in javascript from your xml file is out of reach.
nbmalvern
03-20-2008, 01:48 PM
I was hoping there was something I could call with onclick= in the generated href code to trigger the tracking. Something like
onclick="sc_track_this();return true;".
Thanks for taking the time to analyze this for me. StatCounter is amazing.
webado
03-20-2008, 02:43 PM
Statcounter does this essentially but this only works for an html link in the html code of the page. Not something written out from some other javascript.
You may want to revise the way you are building your page. It's fine to use xml as input, but you should use a server-side script to process it and output actual html content, rather than javascript. Unless your reasoning is to keep it all away from robots by all means.
nbmalvern
03-20-2008, 09:06 PM
I got it working by adding this to my javascript:
document.write('<a href="' + getXmlField(x[i],"mp3") + '"');
document.write('onclick="sc_clickstat_call(this);return true;"');
document.write('>');
Thanks
webado
03-21-2008, 03:20 AM
OK, good for you.
I still think your pages are unnecessarily complicated with so much javascript. Definitely not search engine friendly :)
nbmalvern
03-21-2008, 03:54 AM
I appreciate your suggestions, but we can't run server side scripts on our hosting service.
Most of the pages are plain html, but the menu system loads them with javascript. Those have meta tags for search engines. The download pages are loaded from the xml in newest-first order for the current year, oldest-first for past years. The javascript that handles the xml also loads the "Latest Sermon" menu item automatically. After recording is done on Sunday morning all I have to do is add an entry to the xml.
Regarding search engines, some of the information is intentionally obscured. We have missionaries waiting for visas from less than welcoming governments. We don't want a robot digging up something that will cause trouble for them or for others already in those countries.
Thanks again for an awesome product!
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.