Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

page show event to google analytics

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!!

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

page show event to google analytics

Hi Spark -

How exactly you're testing your app?

Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

page show event to google analytics

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);

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

page show event to google analytics

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...

Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

page show event to google analytics

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

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

page show event to google analytics

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

Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

page show event to google analytics

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!!

Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

page show event to google analytics

hello~
any suggestion?Please !!

Spark Chao
Posts: 0
Joined: Sat Jan 17, 2015 6:25 am

page show event to google analytics

hello~
Awesome appery employee
Do you have any information?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

page show event to google analytics

Hi Spark -

We're sorry for delayed response here.

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

Return to “Issues”