kriserickson / cordova-piwik-plugin

Piwik Plugin for Apache Cordova
4 stars 0 forks source link

Simplest example #2

Closed mmuszkow closed 9 years ago

mmuszkow commented 9 years ago

Hi, I tried this code on both Android 4.4.4 and iOS 8.3 (Cordova 5.1.1):

piwik.startTracker('***', ***);
piwik.traceScreenView('/index.html');

piwik object exists, but I get this error (on both platforms):

[Error] TypeError: undefined is not a function (evaluating 'piwik.traceScreenView('/index.html')')
    (anonymous function) (index.html, line 91)
    fire (cordova.js, line 771)
    (anonymous function) (cordova.js, line 224)

Am I missing something?

kriserickson commented 9 years ago

It is trackScreenView, not traceScreenView.

mmuszkow commented 9 years ago

Sorry about that, stupid typo... Anyway I still can't run the simplest example. I had this (working) code:

<script src="http://***/piwik.js"></script>
...
var piwikTracker = Piwik.getTracker('http://***/piwik.php', 2178);
piwikTracker.trackPageView();

With this one, I can see the users of my page on Piwik dashboard. Now, I switch to your library:

piwik.startTracker('http://***/piwik.php', 2178);
piwik.trackScreenView('/index.html');

and I see no info coming. I tried also index.html, *, /* and empty string in trackScreenView. What value should the path parameter have?