drflash / gaforflash

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

check utmp #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
some use case:

 * call trackPageview() without parameter
 * when we can not obtain the domain name
 * or when the domain name is "localhost"

utmp should at the minimum be "/"
and never the empty string

Original issue reported on code.google.com by zwetan on 27 Nov 2008 at 12:04

GoogleCodeExporter commented 9 years ago

Original comment by zwetan on 4 Dec 2008 at 3:16

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I did notice that utmp was empty for IE 7.0.5730.13 when calling trackPageview()
without parameter in AS3 mode. Example:

http://roirevolution.com/internal/jeremy/flash3/flashtrack.html

Clicking button results in empty utmp when it should be
/internal/jeremy/flash3/flashtrack.html.

Actionscript used on this swf:

import com.google.analytics.AnalyticsTracker;
import com.google.analytics.GATracker;
var tracker:AnalyticsTracker = new GATracker( this, "UA-111-222",
"AS3", false );
mybutton_btn.addEventListener(MouseEvent.CLICK, buttonClicked);
function buttonClicked(event:MouseEvent):void
{
        tracker.trackPageview();
}
stop();

GIF Hit:

GET /__utm.gif
?utmwv=4.3as
&utmn=1986962494
&utmhn=www.roirevolution.com
&utmcs=UTF-8&utmsr=1280x1024
&utmsc=24-bit&utmul=en
&utmje=0&utmfl=10.0 r2
&utmhid=17149229
&utmr=-
&utmp=
&utmac=UA-3000737-2
&utmcc=__utma%3D64144556.784831324379115500.1227653843.1228920064.1228920313.104
0%3B
%2B__utmz%3D64144556.1228831236.1037.2
.utmcsr%3D(direct)
%7Cutmccn%3D(direct)
%7Cutmcmd%3D(none)
%3B HTTP/1.1

Original comment by ja...@roirevolution.com on 10 Dec 2008 at 2:57

GoogleCodeExporter commented 9 years ago
When I test this, it works when there is access to the DOM (ie
ExternalInterface.avaliable = true). So if allowScriptAccess = always, it should
work. If allowScriptAccess=never, utmp is blank. Also if allowScriptAccess =
sameDomain. if the SWF is on another domain utmp is also blank.

The link above doesn't work for me.
Can you confirm allowScriptAccess is indeed set to always and this is not a 
browser
compatibility issue.

As a solution to allowScriptAccess=never we can:

a) default to "/"
b) use the location of the SWF

I'd prefer A, to keep the reporting consistent. If a person want to override the
default, they can use the optional parameter.

Original comment by Nicksk...@gmail.com on 12 Dec 2008 at 9:30

GoogleCodeExporter commented 9 years ago
When we can not obtain the domain name utmp default is now "/"

Original comment by Nicksk...@gmail.com on 15 Dec 2008 at 8:10

GoogleCodeExporter commented 9 years ago
allowScriptAccess is set to always. What troubles me is that it appears there 
must be
access to the DOM since utmp contains the whole pageview in Firefox 3, but in 
IE it's
just blank.

Original comment by ja...@roirevolution.com on 17 Dec 2008 at 1:56

GoogleCodeExporter commented 9 years ago
For reference since you're unable to view the page on 

http://www.roirevolution.com/internal/jeremy/flash3/flashtrack.html

Here's the source code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
Here's my flash tracking page. w00t!
<object width="550" height="400">
<param name="movie"
value="http://www.roirevolution.com/internal/jeremy/flash3/tracking.swf">
<param name="allowScriptAccess" value="always">
<param name="loop" value="false">
<embed src="http://www.roirevolution.com/internal/jeremy/flash3/tracking.swf"
width="550" height="400" allowscriptaccess="always" loop="false" >
</embed>
</object>
</body>
</html>

Maybe there's something I'm doing wrong that would cause this to only work 
correctly
on Firefox on not on IE.

Original comment by ja...@roirevolution.com on 17 Dec 2008 at 2:03

GoogleCodeExporter commented 9 years ago
Hey Jermey,

Do you mind testing this again with the additional classid, name, id, title, 
etc...
params?

The utmp also relies on using ExternalInterface to get the document.location 
from the
browser. The issue here looks like ExternalInterface wasn't properly retrieving 
the
value. 

Original comment by Nicksk...@gmail.com on 22 Jan 2009 at 5:33

GoogleCodeExporter commented 9 years ago
Actually, I did manage to get this to work using a more robust handling of the 
flash
object, including classid, id, sometimes title as well. I'm not sure exactly 
which
parameter was strictly necessary, but everything seems to be working correctly 
now.

Original comment by ja...@roirevolution.com on 22 Jan 2009 at 5:42