Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD support for Cordova google-analytics-plugin #259

Merged
merged 1 commit into from
Dec 16, 2014

Conversation

emaV
Copy link
Contributor

@emaV emaV commented Dec 16, 2014

Currently only the GAPlugin for Cordova/Phonegap (https://github.com/phonegap-build/GAPlugin) is supported (#60 thanks to @mlegenhausen).

This plugin provides an integration of the google-analytics-plugin for Cordova/Phonegap: https://github.com/danwilson/google-analytics-plugin

Usage example:

Before you can start using you need to install the google-analytics-plugin for your platform. The instructions can be found on the homepage.

Then add the plugin file to your index.html file:

<script src="angulartics-ga-cordova-google-analytics-plugin.js"></script>

Now add the module to your app configuration.

angular.module('app', ['angulartics', 'angulartics.google.analytics.cordova']);

Then configure the plugin via:

.config('googleAnalyticsCordovaProvider', function (googleAnalyticsCordovaProvider) {
  googleAnalyticsCordovaProvider.trackingId = 'XXX';
  googleAnalyticsCordovaProvider.debug = true; // default: false
})

That's it you now have mobile google analytics running in your app.

Feedback is welcome!

timelf123 added a commit that referenced this pull request Dec 16, 2014
Add support for Cordova google-analytics-plugin
@timelf123 timelf123 merged commit 6099447 into angulartics:master Dec 16, 2014
@timelf123
Copy link
Contributor

Excellent!

@markvp
Copy link
Contributor

markvp commented Dec 16, 2014

If this is a new plugin, it also requires a new .nuspec file for the NuGet packaging

@timelf123
Copy link
Contributor

@emaV can you add a nuspec file for this plugin?

@pgorsira
Copy link

Would be nice if this was noted in the documentation somewhere - anyway, thanks for this!

@quanghoc
Copy link

quanghoc commented Jul 9, 2015

The dependency on GAPlugin is problematic because this plugin is no longer maintained and completely not functional as of July 2015: phonegap-build/GAPlugin#70

@pgorsira
Copy link

pgorsira commented Jul 9, 2015

quanghoc - I think that's a different plugin than the one we're using. This is what we've got: https://github.com/LawnmowerIO/google-analytics-plugin . AFAIK still working

@quanghoc
Copy link

quanghoc commented Jul 9, 2015

Oh sorry ignore my comment then.

@quanghoc
Copy link

OK I spent half a day trying google-analytics-plugin and it failed at BUILD. Basically depending on google playservices is a huge issue. At this point, nothing works:

http://stackoverflow.com/questions/31332034/build-error-when-using-cordova-google-analytics-plugin

Have you tried and if you have any suggestion?

@mlegenhausen
Copy link
Contributor

Use this fork https://github.com/t-nonque/google-analytics-plugin

There is already an pull request danwilson/google-analytics-plugin#118 maybe if more test and confirm the functionality it gets merged in the official plugin.

@quanghoc
Copy link

The build works now (But I guess because I did reinstalled entire environment). However, I cannot get anything tracked (realtime event). That's probably a different issue. grrr..

I do have window.analytics.startTrackerWithId('XXX'); within device ready event. Then trigger this window.analytics.trackEvent('TestCategory', 'TestAction', 'TestLabel'); and I cannot see anything in Real Time > Events dashboard.

@TompiT
Copy link

TompiT commented Aug 18, 2015

I tried to use following fork: https://github.com/t-nonque/google-analytics-plugin by tracking Screen (i.e. window.analytics.trackView).
I can also confirm that the Real-Time (Overview / Screens) behaviour doesn't work for me either. But if I focus GA metrics on "Today" period I can properly see the Screen information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants