minimedj / gaforflash

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

throw error during "trackPageview" #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write an email which contain a link to a swf, which make use of the
gaforflash library. E.g.
"http://www.tc-helicon.com/Files/FlashFiles/player3ga.swf" or
"http://goanimate.com/go/movie/0d74x1Ssd3sM/1"
2. Send this email to a gmail account.
3. Use firefox to read this email.
4. right click the link in this email, choose "Open in new tab".
5. The error message is shown whenever the swf use the gaforflash library
to track an action.

What is the expected output? What do you see instead?
Expected output: the action is tracked inside the swf's code.
What I see instead: The following error message is shown:
TypeError: Error #1009: Cannot access a property or method of a null object
reference.
    at
com.google.analytics.campaign::CampaignTracker/_addIfNotEmpty()[/buRRRn/projects
/GAforFlash/GA_AS3/build/tmp/com/google/analytics/campaign/CampaignTracker.as:64
]
    at
com.google.analytics.campaign::CampaignTracker/toTrackerString()[/buRRRn/project
s/GAforFlash/GA_AS3/build/tmp/com/google/analytics/campaign/CampaignTracker.as:2
42]
    at
com.google.analytics.campaign::CampaignManager/getCampaignInformation()[/buRRRn/
projects/GAforFlash/GA_AS3/build/tmp/com/google/analytics/campaign/CampaignManag
er.as:234]
    at
com.google.analytics.v4::Tracker/_initData()[/buRRRn/projects/GAforFlash/GA_AS3/
build/tmp/com/google/analytics/v4/Tracker.as:164]
    at
com.google.analytics.v4::Tracker()[/buRRRn/projects/GAforFlash/GA_AS3/build/tmp/
com/google/analytics/v4/Tracker.as:109]
    at
com.google.analytics::GATracker/_trackerFactory()[/buRRRn/projects/GAforFlash/GA
_AS3/build/tmp/com/google/analytics/GATracker.as:215]
    at
com.google.analytics::GATracker/_factory()[/buRRRn/projects/GAforFlash/GA_AS3/bu
ild/tmp/com/google/analytics/GATracker.as:156]
    at
com.google.analytics::GATracker()[/buRRRn/projects/GAforFlash/GA_AS3/build/tmp/c
om/google/analytics/GATracker.as:124]

What version of the product are you using? On what operating system?
Firefox 3.0.4
Flash Player 10,0,12,36

Please provide any additional information below.
You need to satisfy ALL of the following condition in order to trigger the bug:
1. Use web-based gmail (yahoo mail won't trigger this bug)
2. Firefox (IE won't trigger this bug)
3. use "AS3" mode in gaforflash (instead of "bridge" mode)
4. When you read the email and open the link, you must right click the link
and open it in a new tab. If you directly click the link, or you copy and
paste the link to another tab, then the bug won't be triggered.

Original issue reported on code.google.com by eddy%goa...@gtempaccount.com on 4 Dec 2008 at 8:12

GoogleCodeExporter commented 9 years ago
you're linking directly to a SWF file, you should link to an HTML page 
containing the
SWF.

Original comment by zwetan on 5 Dec 2008 at 11:44

GoogleCodeExporter commented 9 years ago
I was experiencing this same issue, but even without linking directly to the 
SWF.
That is, following a link from web-based GMail to a page containing the SWF 
caused
this same stack trace. This should not have the status "WontFix".

My solution was just to surround the instantiation of GATracker with a try/catch
block and not even try to track events if this occurs.

Original comment by atmy...@gmail.com on 23 Dec 2008 at 7:06

GoogleCodeExporter commented 9 years ago
this issue is mainly caused with some code that doesn't wait for the display 
object
to be fully initialized (eg. added to the display list)

nobody have showed us which AS3 code they are using to initialize the tracker 
(or
what email template they are using) in this situation, so there is not much we 
can do
to help.

Wrapping with a try/catch to hide the error will not solve your problem as you 
could
end up having a big percentage of email not tracked at all.

If you have some trouble explaining the real issue our google group is a good 
way to
discuss it.

Original comment by zwetan on 18 Feb 2009 at 6:51

GoogleCodeExporter commented 9 years ago
I was experiencing this same issue.I link to html which contains swf. The error 
shows
only if I open link from gmail. It works if I open the same link from other 
email
systems and if I go directly to the page.

This is the link I insert to the gmail:
<A href="http://www.transparent.com/wotd/today/russian.htm?date=02-17-2009">

Original comment by bozheve...@gmail.com on 9 Mar 2009 at 2:33

GoogleCodeExporter commented 9 years ago
till someone come up with an example with basic source code the status will 
stay as 
wontfix

here what we need:
 * the exact raw text you're sending to the email (not only the link)
 * the exact raw text of the HTML used to diplay the swf
 * which Operating System version you're using
 * which Browser version you are using
 * which Flash Player plugin version
 * YOUR AS3 SOURCE CODE THAT INITIALIZE THE TRACKING

my bet is 90% of your issues is caused because you don't initialize correctly 
the AS3 
source code, but as nobody show how they do this initialization we can not tell 
you 
where is the error

Original comment by zwetan on 9 Mar 2009 at 2:48

GoogleCodeExporter commented 9 years ago
this will work:

try{Utils._tracker = new GATracker( this, "UA-#######-#", "AS3", false );
}catch(e:*) {
this.openLink("http://www.yourdomain.com", "_top")      
}

private function _openLink(urlVar:String, whichWindow:String="_blank"):void
{   
var url:String = urlVar;
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, whichWindow);
} catch (e:Error) {                             
trace("Error occurred!");
}
}       

Original comment by trevor.jordet on 11 Apr 2011 at 8:57

GoogleCodeExporter commented 9 years ago
if your Utils._tracker call is initiated by default, all you need to do is 
reload the page and it won't choke on the reload. (provided google tracker is 
working properly)

I have not seen what happens when google tracker is completely down.  in that 
case I assum the browser would need to be forced closed because it will just 
keep reloading.... maybe add a querystring on the second load so that if it 
fails twice, the page just stops....

Original comment by trevor.jordet on 11 Apr 2011 at 9:02