[Solved] Still no visitors tracked


#1

Hi there,

I just installed Piwik on my server. I set up my Domain inside Pikwik and added the tracking-JavaScript to my site ( http://www.zoosau.de ).
Piwik is available at http://www.zoosau.de/piwik/ and my tracking-JS, embedded like this:


<script type="text/javascript">
									var pkBaseURL = document.location.protocol + "//" + "http://www.zoosau.de" + "/piwik/";
								document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
				</script><script type="text/javascript">
				try {
				var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
				piwikTracker.setDocumentTitle(document.title);
				piwikTracker.trackPageView();
							piwikTracker.enableLinkTracking();
							} catch( err ) {}
				</script>
				<!-- /Piwik -->
	</div>
</body>

But no visitor is displayed in Piwik ( I visited the site several times from different IPs today myself ).
One point in the Piwik FAQ suggests to have a look at the table “piwik_log_visit” if there are any visitors recorded. There’s not, the table is empty.

What do I do wrong?


(vipsoft) #2

Your mods to the tracking code are wrong. Try it without the extra http, eg


var pkBaseURL = document.location.protocol + "://www.zoosau.de/piwik/"


#3

OK, I’ll have a try, but then I think this is a bug:

I don’t want to mess up the facts here, because of that I’d like to explain where I got the codes from:

When I go to “Settings” > “Websites” > “View Tracking code” inside Piwik, this is what I get:


<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.zoosau.de/piwik/" : "http://www.zoosau.de/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://www.zoosau.de/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

But this hasn’t worked - I got no visitors tracked.

After a few hours I installed the Plugin “Piwik Analytics” to my WordPress ( Piwik Analytics WordPress Plugin - Forward Slash ), which created the code, which I first posted.
None of these both variants seems to work for me. Since the above Code from within Piwik itself looks a lot different from the Plugin created one ( which I cannot edit as you mentioned ) I’d like to do the analysis with this code.

Could you or anyone guess why this isn’t working?


(vipsoft) #4

FF says there’s an error. Because this script is executed before the Piwik code, its failure prevents the Piwik tracking code from being executed.

Error: document.getElementsByTagName(“body”)[0] is undefined
Source File: http://www.zoosau.de/wp-content/js/awstats_misc_tracker.js
Line: 156


#5

Sorry, but this exceeds my knowledge :stuck_out_tongue: How can I fix it?


#6

Could you please explain to me how this error might occour? I Copy&Pasted the Piwik Code 1:1 from the BackEnd … :stuck_out_tongue:


(vipsoft) #7

The error isn’t in the Piwik code. It’s one of your other scripts.


#8

Sorry, I do not believe this:

I changed my Site temporarly to another Dir, where just 1 single index.html file is available:


<html>
<head>
<title>Just a Piwik Testsite</title>
</head>
<body>
Just a Test ...
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://www.zoosau.de/piwik/" : "http://www.zoosau.de/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://www.zoosau.de/piwik/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
</body>
</html>

This is exactly the Piwik code from the Piwik Backend. And I get no visitors recorded to piwik ( MySQL table “piwik_log_visit” is still empty ). Since there’s simly no other code left, it has to do something with piwik.


(vipsoft) #9

Please edit piwik.php, and enable debugging.


$GLOBALS['PIWIK_TRACKER_DEBUG'] = true;

Then open this URL in your browser: www.zoosau.de/piwik/piwik.php?idsite=1


#10

Since I’m having the same issue, roughly, I followed your instructions and here’s my dump…

Debug enabled - Input parameters:
array ( ‘idsite’ => ‘1’, )
Loading plugins: { Provider,Goals }
Current datetime: 2011-04-25 02:46:04
GET parameter rec not found in URL, request excluded
Visitor excluded.
-> Scheduled tasks not triggered.
Next run will be from: 2011-04-25 03:36:15 UTC
Nothing to notice => default behaviour
End of the page.

array (
)

Time elapsed: 0.019s

I had Piwik working and reporting on my Wordpress installs last year, then it stopped reporting.

piwik_log_visit shows visitors, but dashboard shows zero.

I was using the plugin, just now pasted the js in the footer of my WP installs. I’m aware that WP went through some major changes recently and this may be the issue. But I’d like a reading of my dump, please.

Thank you for any help.


(vipsoft) #11

seedy. I think you have a different issue. try this patch http://dev.piwik.org/trac/changeset/4547


#12

Hi Anthon,

I admit to being technically-challenged, exp. with terminal commands. I used C/P to change my /core/Piwik.php file to match the diff. Logged in and see no changes, but am thinking that perhaps it needs to “reboot” somehow or have the cache cleared to work from those changes? Can’t find a GUI way to do that, can SSH in if know the right command to use.

Since I pasted the tracking code in my footers yesterday I have one visit, which was myself messing with sites last night. DB usage shows many more.

EDIT: Went into db and found that no tracking has occurred for months. Yes, this means I wasn’t watching it for a while, but it also probably means that an upgrade at some point stopped tracking without any warnings, and now I have no data on the transition work I was doing on my websites, which is why I installed it in the first place. So no need to continue helping me, I nuked Piwik. Thank you for your efforts and replies.


#13

i have the same problem


#14

Hi Anthon ,

sorry for not replying for 4 days … I was not in the office and had no I-net the last days …

Unfortunately, I can not test what you suggested: When I’m trying to open the address you suggested, my server offers me a zero-sized file named piwik.php for download. This happens regardless of the debug-mode.

What’s wrong here?


#15

Hi everyone,

I have solved this issue on myself:

I have setup Piwik like documented. That my Webserver provided an empty PHP file instead of rendering it, made me wonder. I knew this has to be an issue with the code itself within this file. Since this is valid, I tried to follow the code within piwik.php and found the following:

The file uses a Database resource, which is defined in config/global.ini.php and is overwritten by the content of whatever is defined within config/config.ini.php .

There is a part for the database config within these files :

In global.ini.php it reads:


[database]
...
adapter                 = PDO_MYSQL
...

This becomes overwritten with the following from config.ini.php :


[database]
...
adapter = "MYSQLI"
...

So I just edited my config.ini.php to use “PDO_MYSQL” instead of “MYSQLI” and now it works! :slight_smile:

This seems to be a bug in the automatic routine for what’s available and functional insede the Piwik installer, since it set MYSQLI even it isn’t working on my server.
If anybody of the developers wants to get further details about my machine, I can provide them. Just ask.

Thank you all for your help so far! :slight_smile:


(vipsoft) #16

AFAIK there aren’t any mysqli tracking issues, but I can investigate if you PM your phpinfo, mysql server version, and mysql output from:


SHOW VARIABLES;


#17

Hi Anthon,

thank you, but there seems to be and it’s known: http://dev.piwik.org/trac/ticket/2370

That’s my bug entry and it has been marked as duplicate :wink: Seems to be already fixed in 1.4.