Page 1 of 2

page show event to google analytics

Posted: Thu Apr 16, 2015 3:20 am
by Spark Chao

Hello
When I follow your tutorials to create the google analytics.
"Using the Google Analytics API"

I can get some dada form my app about base information.
but the eventpageshow not collect any information in google analytics.
I follow your tutorials,in my app first page add a device ready event like below.

initGA();
trackPage('firstpage');

and each page also add the following code.

trackPage('pagename');

did some step I do wrong?
or I have to follow another suggestion?
https://getsatisfaction.com/apperyio/...

thanks!!


page show event to google analytics

Posted: Thu Apr 16, 2015 5:36 pm
by Illya Stepanov

Hi Spark -

How exactly you're testing your app?


page show event to google analytics

Posted: Fri Apr 17, 2015 7:32 am
by Spark Chao

Illya
So sorry ,I did clearly defined the problem.
problem 1
when I test the app on android system.
the app alway open the alarm like below.
but it will not appear on iOS device.
Image Image
it is mean the iOS google analytics is not working?
and how can I close the alarm?

problem 2
if I just want to track how many view per page.
do I just add the the code like that ?

trackPage('pagename');

problem 3
If I hope I can track the category name which user click.
and the category name will receive from db,and show on list component.
Image
can I add the code like that?

var categoryname=localStorage.getItem('e_category');
trackEvent("e_category", "click", "categoryname", 1);


page show event to google analytics

Posted: Sat Apr 18, 2015 6:56 am
by Serhii Kulibaba

Hello,
but it will not appear on iOS device.
Please try to debug your project http://devcenter.appery.io/documentat...

problem 2,3:
Please follow google analytics documentation:
https://developers.google.com/analyti...


page show event to google analytics

Posted: Mon Apr 20, 2015 9:54 am
by Spark Chao

Sergly
Thanks for your reply.
if I only track pageview.
should I only paste the following code to js and don't need to change anything.
(the analytics id must to be changed)
or how can I modify your tutorials ?just remove the code about alert?

var _gaq = _gaq || [];

gaq.push(['setAccount', 'UA-17912306-1']);

gaq.push(['trackPageview']);

//Add event handler on page show.

var onPageShow = function(){

Code: Select all

 //Track page into GA when it has been shown 

 _gaq.push(['_trackPageview', window.location.href]); 

};

jQuery(document).bind("pageshow", onPageShow);

(function() {

Code: Select all

 var ga = document.createElement('script'); 

 ga.type = 'text/javascript'; 

 ga.async = true; 

 ga.src = ('https:' == document.location.protocol ? '[url=https://ssl]https://ssl[/url]' : '[url=http://www]http://www[/url]') + '.google-analytics.com/ga.js'; 

 var s = document.getElementsByTagName('script')[0]; 

 s.parentNode.insertBefore(ga, s); 

})();

and when I would like to debug my app in Weinre .
but it is not find anything!
what's wrong? Image Image


page show event to google analytics

Posted: Mon Apr 20, 2015 8:49 pm
by Serhii Kulibaba

Where did you add this code? (page/event)


page show event to google analytics

Posted: Tue Apr 21, 2015 3:14 am
by Spark Chao

Sergiy
so sorry not describe my problem clearly.
Problem 1:
now,I only follow your tutorials to link google analytic "Using the Google Analytics API" .
but the android always popup the alert,and iOS still not working.
how can I remove the alert base on your tutorials js code.
and debug the problem on iOS,because the Weinre can't find my project.

Problem 2:
Because I met the problem 1,then I search this forum for solution.
Your employee and some user suggestion can use the code last article I posted.
Do I only need place the entire code to each page /pageshow event?
(only replace the analytics id)
and should I also need to remove the js code and event which I follow the tutorials to add.

Thanks your so much!!


page show event to google analytics

Posted: Wed Apr 22, 2015 6:13 am
by Spark Chao

hello~
any suggestion?Please !!


page show event to google analytics

Posted: Mon Apr 27, 2015 4:41 am
by Spark Chao

hello~
Awesome appery employee
Do you have any information?


page show event to google analytics

Posted: Mon Apr 27, 2015 11:55 am
by Illya Stepanov

Hi Spark -

We're sorry for delayed response here.

We are currently investigating this Google Analytics issue on iOS devices.