Tracking does not work on a new installation

We have installed the latest version of Piwik on IIS and added 5 sites and added the tracking code to each site, but none of the site visits are being logged. We have set up Piwik on the root of https://stats.spydus.co.uk and are using the tracking code below on the example URL below:

Please can somebody give me some pointers on how to get this working. I have been through the help section on the issue and no joy.

https://richmond.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/HOME

    var _paq = _paq || [];
    (function(){
    var u = (("https:" == document.location.protocol) ? 'https://stats.spydus.co.uk/' : 'http://stats.spydus.co.uk/');
    _paq.push(['setSiteId', 3]);
    _paq.push(['setTrackerUrl', u + 'piwik.php']);
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
    g.type = 'text/javascript';
    g.defer = true;
    g.async = true;
    g.src = u + 'piwik.js';
    s.parentNode.insertBefore(g, s);
    })();
  </script><!-- End Piwik Code -->

You changed the tracking code:

should be

var u=((“https:” == document.location.protocol) ? “https” : “http” ) + “://stats.spydus.co.uk/”;

or if you don’t want to test for the protocol

var u=(“https://stats.spydus.co.uk/” );

Thanks for getting back to me Steve. I changed the code to the above but the logging is still not appearing. Can you help?

I have added the tracking code below to www.dustdiva.co.uk because it’s quicker to change and test. It is sending the request to https://stats.spydus.co.uk (See request at the bottom of this post) but no data is being reported. Any ideas what’s wrong?

/piwik.php?action_name=Dust%20Diva%20-%20North%20Devon%20Cleaning%20Services%20-%20North%20Devon%2C%20Umberleigh%2C%20Barnstaple%2C%20Bideford&idsite=6&rec=1&r=461771&h=9&m=14&s=9&url=http%3A%2F%2Fwww.dustdiva.co.uk%2F&_id=30279c312eadddee&_idts=1407748237&_idvc=2&_idn=0&_refts=0&_viewts=1407748599&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=1&java=1&gears=0&ag=1&cookie=1&res=1680x1050&gt_ms=1700

I have run firebug on the tracking request and can see that the tracking isn’t working because of the following error. Anyone know how to fix this?

Error query: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘location_provider’ in ‘field list’ In query: INSERT INTO piwik_log_visit (idsite, visitor_localtime, idvisitor, visitor_returning, visitor_count_visits, visitor_days_since_last, visitor_days_since_order, visitor_days_since_first, visit_first_action_time, visit_last_action_time, visit_entry_idaction_url, visit_entry_idaction_name, visit_exit_idaction_url, visit_exit_idaction_name, visit_total_actions, visit_total_searches, visit_total_events, visit_total_time, visit_goal_buyer, referer_type, referer_name, referer_url, referer_keyword, config_id, config_os, config_os_version, config_browser_name, config_browser_version, config_resolution, config_device_type, config_device_model, config_device_brand, config_pdf, config_flash, config_java, config_director, config_quicktime, config_realplayer, config_windowsmedia, config_gears, config_silverlight, config_cookie, location_ip, location_browser_lang, visit_goal_converted, location_provider, location_country) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) Parameters: array ( 0 => 6, 1 => ‘10:52:10’, 2 => ‘�5��r’, 3 => 1, 4 => 2, 5 => 5, 6 => 0, 7 => 5, 8 => ‘2014-08-13 09:52:44’, 9 => ‘2014-08-13 09:52:44’, 10 => 5, 11 => 4, 12 => 5, 13 => 4, 14 => 1, 15 => 0, 16 => 0, 17 => 0, 18 => 0, 19 => 1, 20 => false, 21 => ‘’, 22 => false, 23 => ‘�F �r=��’, 24 => ‘WI7’, 25 => ‘7’, 26 => ‘FF’, 27 => ‘31.0’, 28 => ‘1344x840’, 29 => 0, 30 => ‘’, 31 => ‘’, 32 => 1, 33 => 1, 34 => 0, 35 => 0, 36 => 0, 37 => 0, 38 => 0, 39 => 0, 40 => 1, 41 => 1, 42 => ’ SD�’, 43 => ‘en-us,en’, 44 => 0, 45 => ‘Ip’, 46 => ‘us’, )
Backtrace:

#0 C:\inetpub\wwwroot\Piwik\core\Tracker\Visit.php(444): Piwik\Tracker\Db\Pdo\Mysql->query(‘INSERT INTO piw…’, Array)
#1 C:\inetpub\wwwroot\Piwik\core\Tracker\Visit.php(325): Piwik\Tracker\Visit->insertNewVisit(Array)
#2 C:\inetpub\wwwroot\Piwik\core\Tracker\Visit.php(206): Piwik\Tracker\Visit->handleNewVisit(Object(Piwik\Tracker\ActionPageview), false)
#3 C:\inetpub\wwwroot\Piwik\core\Tracker.php(872): Piwik\Tracker\Visit->handle()
#4 C:\inetpub\wwwroot\Piwik\core\Tracker.php(242): Piwik\Tracker->trackRequest(Array, NULL)
#5 C:\inetpub\wwwroot\Piwik\piwik.php(121): Piwik\Tracker->main()
#6 {main}

If that column is missing, your table is not setup correctly. If you haven’t collected any data, you might want to try reinstalling.

Thanks sneakyllama, unsinstalling and reinstalling the latest version has sorted it. Tracking is working now :slight_smile:

Which version of Piwik do you use?

Could you try upgrade to 2.5.0-rc1 published just today?

If you stil have the issue after upgrading please disable the Provider plugin.

Have upgraded to 2.4 and that has sorted it.