Skip to content

Commit

Permalink
Merge pull request phonegap#705 from kieranshaw/master
Browse files Browse the repository at this point in the history
[iOS] Fix for issue #704: GoogleAnalyticsPlugin upgrade to Cordova 2.0
  • Loading branch information
shazron committed Aug 27, 2012
2 parents 7429c53 + cc44244 commit 2f57931
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions iOS/GoogleAnalytics/GoogleAnalyticsPlugin.js
@@ -1,26 +1,26 @@
function GoogleAnalyticsPlugin() {}

GoogleAnalyticsPlugin.prototype.startTrackerWithAccountID = function(id) {
PhoneGap.exec("GoogleAnalyticsPlugin.startTrackerWithAccountID",id);
cordova.exec("GoogleAnalyticsPlugin.startTrackerWithAccountID",id);
};

GoogleAnalyticsPlugin.prototype.trackPageview = function(pageUri) {
PhoneGap.exec("GoogleAnalyticsPlugin.trackPageview",pageUri);
cordova.exec("GoogleAnalyticsPlugin.trackPageview",pageUri);
};

GoogleAnalyticsPlugin.prototype.trackEvent = function(category,action,label,value) {
var options = {category:category,
action:action,
label:label,
value:value};
PhoneGap.exec("GoogleAnalyticsPlugin.trackEvent",options);
cordova.exec("GoogleAnalyticsPlugin.trackEvent",options);
};

GoogleAnalyticsPlugin.prototype.setCustomVariable = function(index,name,value) {
var options = {index:index,
name:name,
value:value};
PhoneGap.exec("GoogleAnalyticsPlugin.setCustomVariable",options);
cordova.exec("GoogleAnalyticsPlugin.setCustomVariable",options);
};

GoogleAnalyticsPlugin.prototype.hitDispatched = function(hitString) {
Expand All @@ -30,7 +30,7 @@ GoogleAnalyticsPlugin.prototype.trackerDispatchDidComplete = function(count) {
//console.log("trackerDispatchDidComplete :: " + count);
};

PhoneGap.addConstructor(function() {
cordova.addConstructor(function() {
if(!window.plugins) window.plugins = {};
window.plugins.googleAnalyticsPlugin = new GoogleAnalyticsPlugin();
});

0 comments on commit 2f57931

Please sign in to comment.