wrong determined site
-
hi, i have a problem with piwik, i have the plugin installed on two wp sites and they both show up in the piwik dashboard too, but in one of the wp installs it shows the wrong site as the ‘determined site’ and consequently all visits are tracked under one of the two sites instead of separately.
i tried removing them and recreating them-… all wih the same result. if i use the sitebrowser feature, it shows the the correct url on both wp installs, but on on of them it shows the wrong site id …
any clues?
-
Can you try to run the test script? (See: Settings -> WP-Piwik -> Support.) It should give a hint which URL is used to determine the site ID, and what Piwik answers (see Test 3/3 in test script results).
Also, please check the entered site URLs in your Piwik site configuration.
Thank you!
both sites are configured / show correctly in piwik, the test scripts return this:
***for the site that is shows combined tracking data for both installs: ***
WP-Piwik 1.0.3 Mode: http Test 1/3: global.getPiwikVersion string(6) "2.14.2" array(2) { [0]=> string(223) "HTTP/1.1 200 OK Server: nginx/1.7.9 Date: Thu, 06 Aug 2015 07:22:52 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Host-Header: 192fc2e7e50945beb8231a492d6a8024 " [1]=> string(149) "https://stefan-reindl.com/analytics/?module=API&method=API.getBulkRequest&format=json&urls[0]=method%3DAPI.getPiwikVersion%26idSite%3D8&token_auth=..." } Test 2/3: SitesManager.getSitesWithAtLeastViewAccess array(2) { [0]=> array(16) { ["idsite"]=> int(8) ["name"]=> string(14) "Awesome Slides" ["main_url"]=> string(25) "https://www.awesomeslid.es" ["ts_created"]=> string(19) "2015-08-06 02:33:19" ["ecommerce"]=> int(0) ["sitesearch"]=> int(1) ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(13) "Asia/Shanghai" ["currency"]=> string(3) "USD" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> int(0) } [1]=> array(16) { ["idsite"]=> int(9) ["name"]=> string(13) "Stefan Reindl" ["main_url"]=> string(28) "https://www.stefan-reindl.com" ["ts_created"]=> string(19) "2015-08-06 02:37:34" ["ecommerce"]=> int(0) ["sitesearch"]=> int(1) ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(13) "Asia/Shanghai" ["currency"]=> string(3) "USD" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> int(0) } } array(2) { [0]=> string(223) "HTTP/1.1 200 OK Server: nginx/1.7.9 Date: Thu, 06 Aug 2015 07:22:52 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Host-Header: 192fc2e7e50945beb8231a492d6a8024 " [1]=> string(172) "https://stefan-reindl.com/analytics/?module=API&method=API.getBulkRequest&format=json&urls[0]=method%3DSitesManager.getSitesWithAtLeastViewAccess%26idSite%3D8&token_auth=..." } Test 3/3: SitesManager.getSitesIdFromSiteUrl array(1) { [0]=> array(1) { ["idsite"]=> int(8) } } array(2) { [0]=> string(223) "HTTP/1.1 200 OK Server: nginx/1.7.9 Date: Thu, 06 Aug 2015 07:22:52 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Host-Header: 192fc2e7e50945beb8231a492d6a8024 " [1]=> string(204) "https://stefan-reindl.com/analytics/?module=API&method=API.getBulkRequest&format=json&urls[0]=method%3DSitesManager.getSitesIdFromSiteUrl%26idSite%3D8%26url%3Dhttp%3A%2F%2Fwww.awesomeslid.es&token_auth=..." } array(2) { ["global_settings"]=> array(56) { ["revision"]=> string(10) "2015072101" ["last_settings_update"]=> string(10) "1438828577" ["piwik_mode"]=> string(4) "http" ["piwik_url"]=> string(35) "https://stefan-reindl.com/analytics/" ["piwik_path"]=> string(0) "" ["piwik_user"]=> string(0) "" ["piwik_token"]=> string(3) "set" ["auto_site_config"]=> string(1) "1" ["default_date"]=> string(9) "yesterday" ["stats_seo"]=> string(1) "0" ["dashboard_widget"]=> string(8) "disabled" ["dashboard_chart"]=> string(1) "0" ["dashboard_seo"]=> string(1) "0" ["toolbar"]=> string(1) "0" ["capability_read_stats"]=> array(5) { ["administrator"]=> string(1) "1" ["editor"]=> string(1) "0" ["author"]=> string(1) "0" ["contributor"]=> string(1) "0" ["subscriber"]=> string(1) "0" } ["perpost_stats"]=> string(1) "0" ["plugin_display_name"]=> string(8) "WP-Piwik" ["piwik_shortcut"]=> string(1) "0" ["shortcodes"]=> string(1) "0" ["track_mode"]=> string(7) "default" ["track_codeposition"]=> string(6) "footer" ["track_noscript"]=> string(1) "0" ["track_nojavascript"]=> string(1) "0" ["proxy_url"]=> string(30) "//stefan-reindl.com/analytics/" ["track_content"]=> string(7) "visible" ["track_search"]=> string(1) "0" ["track_404"]=> string(1) "0" ["add_post_annotations"]=> string(1) "0" ["add_customvars_box"]=> string(1) "0" ["add_download_extensions"]=> string(0) "" ["disable_cookies"]=> string(1) "0" ["limit_cookies"]=> string(1) "0" ["limit_cookies_visitor"]=> string(8) "34186669" ["limit_cookies_session"]=> string(4) "1800" ["limit_cookies_referral"]=> string(8) "15778463" ["track_admin"]=> string(1) "0" ["capability_stealth"]=> array(0) { } ["track_across"]=> string(1) "0" ["track_across_alias"]=> string(1) "0" ["track_feed"]=> string(1) "0" ["track_feed_addcampaign"]=> string(1) "0" ["track_feed_campaign"]=> string(4) "feed" ["track_heartbeat"]=> string(1) "0" ["cache"]=> string(1) "1" ["http_connection"]=> string(4) "curl" ["http_method"]=> string(4) "post" ["disable_timelimit"]=> string(1) "0" ["connection_timeout"]=> string(1) "5" ["disable_ssl_verify"]=> string(1) "0" ["piwik_useragent"]=> string(3) "php" ["piwik_useragent_string"]=> string(8) "WP-Piwik" ["track_datacfasync"]=> string(1) "0" ["track_cdnurl"]=> string(0) "" ["track_cdnurlssl"]=> string(0) "" ["force_protocol"]=> string(8) "disabled" ["update_notice"]=> string(7) "enabled" } ["settings"]=> array(6) { ["name"]=> string(0) "" ["site_id"]=> string(1) "8" ["noscript_code"]=> string(115) "<noscript><p><img src="//stefan-reindl.com/analytics/piwik.php?idsite=8" style="border:0;" alt="" /></p></noscript>" ["tracking_code"]=> string(570) "<!-- Piwik --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['trackVisibleContentImpressions']); _paq.push(['enableLinkTracking']); (function() { var u="//stefan-reindl.com/analytics/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', 8]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Piwik Code --> " ["last_tracking_code_update"]=> string(10) "1438828577" ["dashboard_revision"]=> string(1) "0" } }
and
***for the site that shows the right url under sitebrowser but the wront one under ‘determined site’,and for which nothing is being tracked: ***WP-Piwik 1.0.3 Mode: http Test 1/3: global.getPiwikVersion string(6) "2.14.2" array(2) { [0]=> string(223) "HTTP/1.1 200 OK Server: nginx/1.7.9 Date: Thu, 06 Aug 2015 07:24:13 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Host-Header: 192fc2e7e50945beb8231a492d6a8024 " [1]=> string(149) "https://stefan-reindl.com/analytics/?module=API&method=API.getBulkRequest&format=json&urls[0]=method%3DAPI.getPiwikVersion%26idSite%3D8&token_auth=..." } Test 2/3: SitesManager.getSitesWithAtLeastViewAccess array(2) { [0]=> array(16) { ["idsite"]=> int(8) ["name"]=> string(14) "Awesome Slides" ["main_url"]=> string(25) "https://www.awesomeslid.es" ["ts_created"]=> string(19) "2015-08-06 02:33:19" ["ecommerce"]=> int(0) ["sitesearch"]=> int(1) ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(13) "Asia/Shanghai" ["currency"]=> string(3) "USD" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> int(0) } [1]=> array(16) { ["idsite"]=> int(9) ["name"]=> string(13) "Stefan Reindl" ["main_url"]=> string(28) "https://www.stefan-reindl.com" ["ts_created"]=> string(19) "2015-08-06 02:37:34" ["ecommerce"]=> int(0) ["sitesearch"]=> int(1) ["sitesearch_keyword_parameters"]=> string(0) "" ["sitesearch_category_parameters"]=> string(0) "" ["timezone"]=> string(13) "Asia/Shanghai" ["currency"]=> string(3) "USD" ["excluded_ips"]=> string(0) "" ["excluded_parameters"]=> string(0) "" ["excluded_user_agents"]=> string(0) "" ["group"]=> string(0) "" ["type"]=> string(7) "website" ["keep_url_fragment"]=> int(0) } } array(2) { [0]=> string(223) "HTTP/1.1 200 OK Server: nginx/1.7.9 Date: Thu, 06 Aug 2015 07:24:14 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Host-Header: 192fc2e7e50945beb8231a492d6a8024 " [1]=> string(172) "https://stefan-reindl.com/analytics/?module=API&method=API.getBulkRequest&format=json&urls[0]=method%3DSitesManager.getSitesWithAtLeastViewAccess%26idSite%3D8&token_auth=..." } Test 3/3: SitesManager.getSitesIdFromSiteUrl array(1) { [0]=> array(1) { ["idsite"]=> int(9) } } array(2) { [0]=> string(223) "HTTP/1.1 200 OK Server: nginx/1.7.9 Date: Thu, 06 Aug 2015 07:24:14 GMT Content-Type: application/json; charset=utf-8 Transfer-Encoding: chunked Connection: keep-alive Host-Header: 192fc2e7e50945beb8231a492d6a8024 " [1]=> string(207) "https://stefan-reindl.com/analytics/?module=API&method=API.getBulkRequest&format=json&urls[0]=method%3DSitesManager.getSitesIdFromSiteUrl%26idSite%3D8%26url%3Dhttp%3A%2F%2Fwww.stefan-reindl.com&token_auth=..." } array(2) { ["global_settings"]=> array(56) { ["revision"]=> string(10) "2015072101" ["last_settings_update"]=> string(10) "1438828690" ["piwik_mode"]=> string(4) "http" ["piwik_url"]=> string(35) "https://stefan-reindl.com/analytics/" ["piwik_path"]=> string(0) "" ["piwik_user"]=> string(0) "" ["piwik_token"]=> string(3) "set" ["auto_site_config"]=> string(1) "1" ["default_date"]=> string(9) "yesterday" ["stats_seo"]=> string(1) "0" ["dashboard_widget"]=> string(8) "disabled" ["dashboard_chart"]=> string(1) "0" ["dashboard_seo"]=> string(1) "0" ["toolbar"]=> string(1) "0" ["capability_read_stats"]=> array(5) { ["administrator"]=> string(1) "1" ["editor"]=> string(1) "0" ["author"]=> string(1) "0" ["contributor"]=> string(1) "0" ["subscriber"]=> string(1) "0" } ["perpost_stats"]=> string(1) "0" ["plugin_display_name"]=> string(8) "WP-Piwik" ["piwik_shortcut"]=> string(1) "0" ["shortcodes"]=> string(1) "0" ["track_mode"]=> string(7) "default" ["track_codeposition"]=> string(6) "footer" ["track_noscript"]=> string(1) "0" ["track_nojavascript"]=> string(1) "0" ["proxy_url"]=> string(30) "//stefan-reindl.com/analytics/" ["track_content"]=> string(7) "visible" ["track_search"]=> string(1) "0" ["track_404"]=> string(1) "0" ["add_post_annotations"]=> string(1) "0" ["add_customvars_box"]=> string(1) "0" ["add_download_extensions"]=> string(0) "" ["disable_cookies"]=> string(1) "0" ["limit_cookies"]=> string(1) "0" ["limit_cookies_visitor"]=> string(8) "34186669" ["limit_cookies_session"]=> string(4) "1800" ["limit_cookies_referral"]=> string(8) "15778463" ["track_admin"]=> string(1) "0" ["capability_stealth"]=> array(0) { } ["track_across"]=> string(1) "0" ["track_across_alias"]=> string(1) "0" ["track_feed"]=> string(1) "0" ["track_feed_addcampaign"]=> string(1) "0" ["track_feed_campaign"]=> string(4) "feed" ["track_heartbeat"]=> string(1) "0" ["cache"]=> string(1) "1" ["http_connection"]=> string(4) "curl" ["http_method"]=> string(4) "post" ["disable_timelimit"]=> string(1) "0" ["connection_timeout"]=> string(1) "5" ["disable_ssl_verify"]=> string(1) "0" ["piwik_useragent"]=> string(3) "php" ["piwik_useragent_string"]=> string(8) "WP-Piwik" ["track_datacfasync"]=> string(1) "0" ["track_cdnurl"]=> string(0) "" ["track_cdnurlssl"]=> string(0) "" ["force_protocol"]=> string(8) "disabled" ["update_notice"]=> string(7) "enabled" } ["settings"]=> array(6) { ["name"]=> string(0) "" ["site_id"]=> string(1) "8" ["noscript_code"]=> string(115) "<noscript><p><img src="//stefan-reindl.com/analytics/piwik.php?idsite=8" style="border:0;" alt="" /></p></noscript>" ["tracking_code"]=> string(570) "<!-- Piwik --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['trackVisibleContentImpressions']); _paq.push(['enableLinkTracking']); (function() { var u="//stefan-reindl.com/analytics/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', 8]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); </script> <!-- End Piwik Code --> " ["last_tracking_code_update"]=> string(10) "1438828690" ["dashboard_revision"]=> string(1) "0" } }
does that leave any clues?
thanks
The ID seems to be correct. Can you please try to clear WP-Piwik’s cache? Just go to the expert settings tab, deactivate the cache, and check again? If it’s working as expected, you can re-enable the cache after this.
yes, i have done that (tried before also tried again now, it still recognized the wrong site (the other one) as the ‘determined site’
any other ideas?
You can try to use WP-Piwik’s reset option (see settings -> WP-Piwik -> support). This means you have to reconfigure WP-Piwik once (the reset won’t affect Piwik), but WP-Piwik itself is forced to re-configure the site ID mapping.
i have done that multiple times, along with deletion and re-creation of the sites in piwik – which is also why with only two sites to track, i am at site ids 8 and 9. i still get the same result tho: the first site i add will be the one tracking everything (also the second site added). the second site i add will have no tracking data recorded and will show the first site as the determined one…
am i really the first case?
Yes, you are. :-/ Of course, there were different cases of wrong determined site IDs, but this could be solved by resetting WP-Piwik or by correcting the Piwik configuration.
Your issue is really strange… so let me try to collect all information:
1.) For any reason, WP-Piwik was not able to determine the correct site ID (9) for “reindl” and stored the wrong one (8) of “slid.es”.
2.) Recreating the sites within Piwik itself did not help – WP-Piwik just replaces the old wrong ID (slid.es instead of reindl) by the new wrong ID (still slid.es instead of reindl).
3.) You checked the domain configuration within Piwik itself. Each site only shows its own valid domain, reindl does not contain a reference to slid.es within the configured URLs.
4.) The test script shows: If WP-Piwik requests the site ID using the reindl-URL, Piwik answers the valid ID (9).
5.) But the test script also shows: The stored ID related to reindl is still 8.
6.) Disabling the cache should force WP-Piwik to re-request the ID. This obviously did not work. (Maybe a bug; I will check this.)
7.) Anyway, a reset should delete all settings stored by WP-Piwik. So resetting WP-Piwik should remove the stored ID (8) and re-request the ID (which will be 9, following the test script).
Conclusion: For any reason WP-Piwik is not able to change or to clear the stored value.
Two ideas:
- Are you using some kind of a caching plugin which may prevent WP-Piwik from updating the value? This would explain the strange behavior except bullet point 2.) – but if you are using such a plugin, it’s worth a try to disable it once for testing.
- For any reason, the reset functionality does not work.
- Can you try to enable WordPress’ debugging and to use the reset link again?
- Does an error message appear?
- Can you, after resetting the plugin, have a look at your database before you re-configure WP-Piwik?
- Check your options table (e.g., wp_options) for
wp-piwik-site_id
. If it still exists, please replace the value (8) by the correct one (9) and try again… does everything work as expected if the value was set manually in the database?
Thank you very much. Meanwhile, I will to re-check the caching and reset functionality this weekend.
- The topic ‘wrong determined site’ is closed to new replies.