Rahul Chidgopkar
Posts: 0
Joined: Tue May 14, 2013 7:11 am

How to add Phonegap Google Analytics Plugin to Appery?

Hi,

I want to add analytics to my Appery app. There is a google analytics phonegap plugin but I'm not sure how to add it to my project.

http://phonegap.com/blog/build/import...

Any tips? BTW, analytics is a pretty important requirement these days. Would be great if the Appery team writes a tutorial on it for everyone's benefit.

Regards,
Rahul.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

How to add Phonegap Google Analytics Plugin to Appery?

Hello! Do you have html5 web or hybrid app?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to add Phonegap Google Analytics Plugin to Appery?

Hi Rahul,

Appery.io doesn't include PhoneGap Google Analytics Plugin by default. To use it export your app to IDE and add the plugin manually please.

You should remember that you can't import your app back to Appery.io after making changes. So I would recommend you to do it just before the app release.

If your app can work with Google Analytics classic JavaScript code you can paste that code into the Panel component.

Rahul Chidgopkar
Posts: 0
Joined: Tue May 14, 2013 7:11 am

How to add Phonegap Google Analytics Plugin to Appery?

Hi Marina & Katya,

I'm building an Android app, not a web app. I don't want the hassle of exporting to IDE and adding a plugin separately.

If I add the GA JS code snippet in a panel component and build an apk file, will it work?

On a related note, any plans of adding analytics support (Google, Flurry, etc) to Appery in the near future?

Thanks,
Rahul.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How to add Phonegap Google Analytics Plugin to Appery?

Hi Rahul,[quote:]If I add the GA JS code snippet in a panel component and build an apk file, will it work?[/quote]Yes, it will.
[quote:]On a related note, any plans of adding analytics support (Google, Flurry, etc) to Appery in the near future? [/quote]We don't have any information about this. Stay tuned for news.

MaratZhalbyrov
Posts: 0
Joined: Wed Nov 06, 2013 12:19 pm

How to add Phonegap Google Analytics Plugin to Appery?

I added GA JS code snippet in a panel component and build an APK file, not work. Google analytics show me visits 0(zero).

Please help.

Thanks Marat.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

How to add Phonegap Google Analytics Plugin to Appery?

Hello! Please tell steps to reproduce.

MaratZhalbyrov
Posts: 0
Joined: Wed Nov 06, 2013 12:19 pm

How to add Phonegap Google Analytics Plugin to Appery?

  1. Drag HTML Panel Component
    1. Paste into the Panel code(below) and try this code http://stackoverflow.com/questions/12...
    2. Build APK file and run on phone
    3. Check Google Analytics result. Unfortunly not working. Application not tracking.
MaratZhalbyrov
Posts: 0
Joined: Wed Nov 06, 2013 12:19 pm

How to add Phonegap Google Analytics Plugin to Appery?

var _gaq = _gaq || [];
gaq.push(['setAccount', 'XX-XXXXXXX-X']);
gaq.push(['trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

MaratZhalbyrov
Posts: 0
Joined: Wed Nov 06, 2013 12:19 pm

How to add Phonegap Google Analytics Plugin to Appery?

var _gaq = _gaq || [];
gaq.push(['setAccount', 'XX-XXXXXXX-X']);
gaq.push(['trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

Return to “Issues”