soumavachakraborty / gaforflash

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

cannot set a nonnull DebugConfiguration #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
this code:

var d:DebugConfiguration =new DebugConfiguration();
var t:GATracker = new GATracker(this, "UA-99999999-1","AS3", false, null, d);

What is the expected output? What do you see instead?

throws this error:
TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
    at 
com.google.analytics::GATracker/_trackerFactory()[/buRRRn/projects/GAforFlash/GA
_AS3/build/
tmp/com/google/analytics/GATracker.as:180]
    at 
com.google.analytics::GATracker/_factory()[/buRRRn/projects/GAforFlash/GA_AS3/bu
ild/tmp/co
m/google/analytics/GATracker.as:156]
    at 
com.google.analytics::GATracker()[/buRRRn/projects/GAforFlash/GA_AS3/build/tmp/c
om/googl
e/analytics/GATracker.as:124]

What version of the product are you using? On what operating system?
v1.0.1.319 on mac os x

Please provide any additional information below.

I took a look in the latest svn.  Looks like the bug is in the constructor for 
GATracker.as,
it should say
else 
{
  this.debug = debug;
}

but it doesnt do that anywhere, so debug is null if you try to set it to 
something.  Would be 
happy to submit a patch.

Original issue reported on code.google.com by daniel%s...@gtempaccount.com on 6 Oct 2009 at 6:41

GoogleCodeExporter commented 8 years ago
the GATracker is a factory that build automatically when you instanciate it

to have a custom debug etc. do this:

//block the auto build
GATracker.autobuild = false;

var d:DebugConfiguration =new DebugConfiguration();
var t:GATracker = new GATracker(this, "UA-99999999-1","AS3", false, null, d);

//customize
t.config.serverMode = ServerOperationMode.both;

//then build
GATracker(tracker).build();

see a complete example here
http://code.google.com/p/gaforflash/source/browse/trunk/src/GA_AS3.as

Original comment by zwetan on 7 Oct 2009 at 10:16