Dear reader, first of all, thanks for taking the time to read my post.
I’ve been trying for the past couple of days to get Goal tracking in Piwik JS operational. The problem is that not once I did manage to track a goal succesfully.
Some special settings and considerations:
- Turned off cookies;
- I have checked numerous times that the website and Goal ID is indeed correct;
- Firebug does not report any JavaScript errors;
- Normal visitor tracking works wonderfully;
- I’ve enabled the e-commerce module;
- I’m positive that my server time is correct because it’s synced every few minutes.
- Also tried it without SSL and without a float number for the order amount.
This is my JavaScript code (which is loaded in an external .js file):
var piwikTracker = Piwik.getTracker("https://www.seo-visuals.com/piwik/piwik.php", 1);
piwikTracker.trackGoal(1, 4.00);
I’ve also made it available online, so that someone can dissect the code:
http://www.seo-visuals.com/test.html
I have also tried the same thing with the PHP api, but this also didn’t track any goal.
Cheers!