nsdevaraj / gaforflash

Automatically exported from code.google.com/p/gaforflash
Apache License 2.0
1 stars 0 forks source link

AIR Unique visitors #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In AIR, all visitors page views show as unique.  Is there a trick to get the 
cookies working in an AIR app?

Original issue reported on code.google.com by nbi...@gmail.com on 16 Nov 2009 at 8:56

GoogleCodeExporter commented 9 years ago
gaforflash in AIR can work but has not been fully tested, it is planed for v1.2

can you gives more details ?

an AIR app (even if not completely supported) should always reuse the same 
"cookie"
and so preserve the visitor ID from one session to another

by session I mean, for the time the AIR app is open

if your issue is a reset of the visitor ID each time the AIR app open, it is 
something to look into

Original comment by zwetan on 18 Nov 2009 at 10:27

GoogleCodeExporter commented 9 years ago
If a user opens the AIR app, and triggers a page view, then the user closes and 
re-
opens the AIR app, and triggers the same page view, that user is counted as a 
unique 
visitor both times.  

Original comment by nbi...@gmail.com on 18 Nov 2009 at 10:43

GoogleCodeExporter commented 9 years ago
I am seeing this problem with a flash app also.  Our application used to be 
AJAX and used Google's javascript 
analytics library.  As soon as we switched to Flash and gaforflash, we lost all 
distinction between page views & 
unique page views.  Every page view is now a visit.

Original comment by stun...@gmail.com on 22 Mar 2010 at 2:28

GoogleCodeExporter commented 9 years ago
we will look into that while testing for AIR 2.0

Original comment by zwetan on 16 Apr 2010 at 3:28

GoogleCodeExporter commented 9 years ago
according to this article : 
http://www.tutkiun.com/2011/04/a-google-analytics-cookie-explained.html, UTMA 
is the cookie concerning the unique visitors.

Theoretically you have to persist this cookie between air app sessions and then 
feed it somehow to the tracker when you instantiate it.

PS: it's a hell debugging because the sources from the svn do not have the same 
line numbers as the compiled swc.

Original comment by cee...@gmail.com on 22 Mar 2013 at 9:17

GoogleCodeExporter commented 9 years ago
hello,
I changed this line in class 'com.google.analytics.v4.Tracker' / function 
'_handleCookie()' :
the line 'if( !_buffer.hasUTMB() || !_buffer.hasUTMC() )' is now 'if( 
!_buffer.hasUTMB() )'

according to : 
http://code.google.com/intl/fr/apis/analytics/docs/concepts/gaConceptsCookies.ht
ml
because :
__utmc  This cookie is no longer used by the ga.js tracking code to determine 
session status.
Historically, this cookie operated in conjunction with the __utmb cookie to 
determine whether or not to establish a new session for the user. 
For backwards compatibility purposes with sites still using the urchin.js 
tracking code, this cookie will continue to be written and will expire when the 
user exits the browser. 
However, if you are debugging your site tracking and you use the ga.js tracking 
code, you should not interpret the existence of this cookie in relation to a 
new or expired session.                     

it seems to solve the problem , not fully tested, but i'm working with this 
version now.

Original comment by molecule3@free.fr on 22 Mar 2013 at 10:02

GoogleCodeExporter commented 9 years ago
found latest build here 
http://gaforflash.googlecode.com/issues/attachment?aid=860008000&name=GoogleAnal
yticsForFlash-r480.swc&token=L-G6BUtdpGsai2PWzmT5Nlo9j_w%3A1363946655734
that matches the source

Original comment by cee...@gmail.com on 22 Mar 2013 at 10:28

GoogleCodeExporter commented 9 years ago
ah...i'm working directly with the GA class package (version 1.0.1.319),
Which version with 'GoogleAnalyticsForFlash-r480.swc' ?

Original comment by molecule3@free.fr on 22 Mar 2013 at 10:45

GoogleCodeExporter commented 9 years ago
found the build here: 
http://code.google.com/p/gaforflash/issues/detail?id=86&sort=-modified&colspec=I
D%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Modified#makechange
s (matches with the sources from the svn), debugged the code and it seems it 
persists the cookies (utma, utmb, ...) and then reads them back. 
but when looking on google analytics website at tracked events I still have 
more unique events than one! (only tested on one phone.. and never deleted the 
shared object that holds the cookies)

Original comment by cee...@gmail.com on 22 Mar 2013 at 10:53

GoogleCodeExporter commented 9 years ago
do you think taking out || !_buffer.hastUTMC() solved that problem? 
if yes, can you build a swc for me? :)
thanks a bunch.

Original comment by cee...@gmail.com on 22 Mar 2013 at 11:01

GoogleCodeExporter commented 9 years ago
I never compiled and distributed a swc (!!), i can try next week.
but you can download the package with all classes, and define the folder in the 
global path (you use Flex ou Flash CS6?).

and yes, taking out || !_buffer.hastUTMC() solved my problem of Unique Visitor 
but i'm not sure of the impact on the rest of the code.

how to communicate directly by e-mail on this subject? no private message on 
'code.google.com' ?

Original comment by molecule3@free.fr on 22 Mar 2013 at 11:15

GoogleCodeExporter commented 9 years ago
ok you can see now my email, you can write me directly =) 

Original comment by molecule3@free.fr on 22 Mar 2013 at 11:18

GoogleCodeExporter commented 9 years ago
I wrote and attached build and test project here 
http://blog.pena.ro/2013/03/google-analytics-unique-visitors-tracking/

still needs testing tho

Original comment by cee...@gmail.com on 22 Mar 2013 at 12:27