soumavachakraborty / gaforflash

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

Internet Explorer not reporting correct utmp in AS3 Mode #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have the following action script on a SWF:

import com.google.analytics.AnalyticsTracker; 
import com.google.analytics.GATracker; 
import flash.net.URLLoader;
import flash.net.URLRequest;
var tracker:AnalyticsTracker = new GATracker( this, "UA-3000737-2", "AS3",
false ); 

groundswell_btn.addEventListener(MouseEvent.CLICK, buttonClicked);

function buttonClicked(event:MouseEvent):void
{
    if (ExternalInterface.available==true){
        tracker.trackPageview();
    } else {
        tracker.trackPageview("/not_available");
    }
}
stop();

This should indicate whether or not the flash object has DOM access.

I tested this on:

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

with the following 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/tracking2.swf"
width="550" height="400" allowScriptAccess="always" loop="false" >
</embed>
</object>
</body>
</html>

When the button is clicked, the hit to the __utm.gif is correct for Firefox
3.0.4 with:

utmp=/internal/jeremy/flash3/flashtrack2.html&

For Internet Explorer 7.0.5730.13, the hit is essentially the same, except
that:

utmp=&

This issue is separate from the utmp=& vs utmp=/&. Even if IE had reported
utmp=/&, it would be incorrect. Also, the flash file clearly has DOM
access, else we'd have:

utmp=/not_available&

When I reversed the condition on the following page:

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

via flash object with actionscript:

function buttonClicked(event:MouseEvent):void
{
    if (ExternalInterface.available!=true){
        tracker.trackPageview();
    } else {
        tracker.trackPageview("/not_available");
    }
}

Both FF and IE had hits with utmp=/not_available&

Also, I have updated my component files to version 1.0.1.319 (Manual tags
work great now, BTW).

Original issue reported on code.google.com by ja...@roirevolution.com on 17 Dec 2008 at 3:47

GoogleCodeExporter commented 9 years ago
Lots of discussion in the comments section here :
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/Externa
lInterface.html

Can you try adding an id parameter to the object tag?

Also, since you are doing the tracking from within a button it should work, but
generally it's best to add the tracking on the 2nd frame or ensure the 
ADDED_TO_STAGE
event has been sent. The Flash visual component should take care of this part 
for you.

Original comment by Nicksk...@gmail.com on 18 Dec 2008 at 5:27

GoogleCodeExporter commented 9 years ago
I added an id parameter to the object tag; still have utmp=&.

Everything is working other than the pageview. It's even reading the manual 
tags from
the URL and coming up with the correct values for utmcsr, utmccn, and utmcmd. 
Do you
have a counter example in AS3 mode where the utmp value is correct in IE with an
empty trackPageview call?

Original comment by ja...@roirevolution.com on 18 Dec 2008 at 6:56

GoogleCodeExporter commented 9 years ago
I set up a simplified test on:

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

Object has id. Here's the source:

<!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 id="my_flash_object" width="1" height="1">
<param name="movie"
value="http://www.roirevolution.com/internal/jeremy/flash3/tracking4.swf">
<param name="allowScriptAccess" value="always">
<param name="loop" value="false">
<embed src="http://www.roirevolution.com/internal/jeremy/flash3/tracking4.swf"
width="1" height="1" allowScriptAccess="always" loop="false" >
</embed>
</object>
</body>
</html>

ActionScript on second frame:

import com.google.analytics.AnalyticsTracker; 
import com.google.analytics.GATracker; 
var tracker:AnalyticsTracker = new GATracker( this, "UA-3000737-2", "AS3", 
false ); 
tracker.trackPageview();

Everything works fine in IE except utmp=&. Works correctly on FireFox except 
that
server message "Transferring data from www.google-analytics.com..." doesn't go 
away.

I tried to set up a test using the visual component instead, but I haven't been 
able
to get that to work yet from the instructions and example in the API 
documentation.

Original comment by ja...@roirevolution.com on 18 Dec 2008 at 7:40

GoogleCodeExporter commented 9 years ago
make more tests for utmp and IE (IE6, IE7, and yeah let be crazy IE8 too)

Original comment by zwetan on 23 Dec 2008 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by zwetan on 23 Dec 2008 at 4:18

GoogleCodeExporter commented 9 years ago
I was able to get this to work with a more robust handling of the flash object,
including classid and id tags.

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

GoogleCodeExporter commented 9 years ago
Issue was not in tracking code, rather in how Flash was embedded into the page. 
The
solution should be to documented as a best practices in the WIKI

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

GoogleCodeExporter commented 9 years ago
Hi,

When you say you get this to work, you mean you fix the IE problems or both the 
IE 
problem and the FF issue with the status bar?

>>Works correctly on FireFox except that
>>server message "Transferring data from www.google-analytics.com..." doesn't 
go 
>>away.

cheers,

Andres

Original comment by andres%l...@gtempaccount.com on 17 Mar 2009 at 3:40

GoogleCodeExporter commented 9 years ago
he means (I guess) that the problem was solved by using a slightly different 
way of 
embedding the SWF into the HTML, and ultimately there were no bug in the 
tracking 
itself (eg. gaforflash)

the firefox status bar with "Transferring data from 
www.google-analytics.com..." not 
going away is a completely unrelated proble

try with another profile see what happen
http://support.mozilla.com/en-us/kb/Managing+profiles

Original comment by zwetan on 17 Mar 2009 at 4:11

GoogleCodeExporter commented 9 years ago
The IE problem is solved. The firefox status bar problem is not, but it's 
probably an
implementation issue rather than a code issue, if no one else sees the issue in 
AS3 mode.

Original comment by ja...@roirevolution.com on 17 Mar 2009 at 4:58

GoogleCodeExporter commented 9 years ago
thanks, I'm getting the same status bar message and I'm sure is an 
implementation
problem because I'm getting it even when the flash movie doesn't contain any GA 
FLASH
tracking code. I was just wondering if you have solve it because I have been 
unable
to find a reliable solution to the problem..

thanks,

Andres

Original comment by andres%l...@gtempaccount.com on 19 Mar 2009 at 12:08