Help get this topic noticed by sharing it on Twitter Twitter, Facebook Facebook, or email.
Claes Gustavsson

How to set up google analytics with build?

Im testing the google analytics plugin with phonegap build.
And it counts the index page right, but when I try to count loading a subpage from my server, it counts that page 5 times?
I have set up e webpage account at google. with http://www.mydomain.se
The pages that I load in the app are at http://www.mydomain.se/somefolder/new...

And I have the following code:
function onDeviceReady()
{
document.addEventListener("resume",onResume,false);
gaPlugin = window.plugins.gaPlugin;
gaPlugin.init(successHandler, errorHandler, "UA-xxxxxxx-1", 10);
gaPlugin.trackPage(successHandler, errorHandler, "index.html");
}
function onResume(){
gaPlugin.trackPage( successHandler, errorHandler, "index.html");
}
function successHandler (result) {
alert('successHandler - '+result);
}

function errorHandler (error) {
alert('errorHandler - '+error);
}
function PageButtonClicked() {
gaPlugin.trackPage( successHandler, errorHandler, "http://www.mydomain.se/somefolder/new...");
}
When I load the news page then the alert pops up 5 times.
Can anybody please tell me where Im going wrong, thanks!
1 person has
this question
+1
Reply