Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

[Bug]: cordovaGoogleAnalytics - trackEvent method is missing argument #1433

Open
sontdhust opened this issue May 23, 2017 · 0 comments
Open

Comments

@sontdhust
Copy link

Report

Factory: $cordovaGoogleAnalytics, method trackEvent is missing newSession argument
https://github.com/driftyco/ng-cordova/blob/master/dist/ng-cordova.js#L3957
Compare to:
https://github.com/danwilson/google-analytics-plugin/blob/master/www/analytics.js#L76

trackEvent = function(category, action, label, value, newSession, success, error) {
  //
}

Reference

Cause the analytics not showing any data #823

How to fix

Update method trackEvent to:

      trackEvent: function (category, action, label, value, newSession) {
        var d = $q.defer();

        $window.analytics.trackEvent(category, action, label, value, newSession, function (response) {
          d.resolve(response);
        }, function (error) {
          d.reject(error);
        });

        return d.promise;
      },
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant