I followed the google analytic tutorial and created a sample app and eventhough its a little slow to respond, it works, I can see the app live. But when I try to add it to an old existing project. its failing to find the ga plug in. I put alert boxes in both testing and real project and in the test one the plugin is found and in the old one its failing to find the plugin
this is the code is used
code
var gaSuccessHandler = function(result) {
//alert('GA initialized: ' + result);
};
var gaErrorHandler = function(error) {
alert('GA initialization failed: ' + error);
};
var gaNativePluginResultHandler = function(result) {
//alert('Event tracked: ' + result);
};
var gaNativePluginErrorHandler = function(error) {
//alert('Event tracking failed: ' + error);
};
var getGAPlugin = function() {
if (window.plugins) {
alert("Plugin found");
console.log('GA Plugin found');
return window.plugins.gaPlugin;
}
alert("Plugin not found");
console.log('GA Plugin NOT found');
};
var initGA = function() {
//console.log('Initialize GA');
if (getGAPlugin()) {
getGAPlugin().init(gaSuccessHandler, gaErrorHandler, 'ournumber', 10);
}
};
/code