by Jesse MacFadyen updated by Olivier Louvignes updated by Chris Kihneman updated by Elvis Ferreira Coelho
Using this plugin requires iOS Cordova and the Google Analytics for Mobile Apps SDK (included). The Google Analytics for Mobile
- Make sure you are running Cordova(PhoneGap) 3.0
- Install using the command:
phonegap local plugin add https://github.com/Krytius/googleAnalytics.git// after device ready, create a local alias and start the tracker with your own id.
var googleAnalytics = window.plugins.googleAnalyticsPlugin;
googleAnalytics.startTrackerWithAccountID("UA-XXXXXXXX-X");
// Track an event in your application
// more here : http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html
googleAnalytics.trackEvent("category", "action", "label goes here", 666);
// Track an pageview in your application (must start with a slash)
googleAnalytics.trackPageview("/test");
In your Build Settings remove armv7s from Valid Architectures.
Patches welcome! Send a pull request. Since this is not a part of Cordova Core (which requires a CLA), this should be easier.
Post issues in the Cordova Google Groups, include in the subject heading - "GoogleAnalyticsPlugin" or on Github (preferred)
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.