English 中文(简体)
Is there a lighter version of Google Analytics for Flash
原标题:

40k of compiled code seems like a lot to me to be making some straightforward flash-javascript calls and makes GA unsuitable for banner ad work as well.

Does anyone know if there is a lite version of Google Analytics for Flash?

最佳回答

How about using directly the javascript functions? say:

ExternalInterface.call("pageTracker._trackPageview", "section/subsection");
ExternalInterface.call("pageTracker._trackEvent", "event", "cat", "label", "value");
问题回答

I don t believe there is a lite version, similarly i don t believe google analytics intended its service be used for ad tracking. That being said, you should try compressing your swf. You can often shave off a big chunk of the file size especially from text source files.

http://www.compress-swf.com/
http://www.softpedia.com/get/Internet/WEB-Design/Flash/swf-compressor.shtml

Cay That should work but how would you pass your custom account ID?

ie If using the GATracker object

var myTacker=GATracker(containerdisplayObject, customaccountID , Bridge ,false)

Depending on what you are trying to track, why not just have the flash call home. Posting some variables to a script that loads them in a database?

var counter:LoadVars = new LoadVars();
counter.gamename = gametitle; //set variables here
counter.sendAndLoad("http://your script", result_lv, "POST");

You will need to perform an ExternalInterface call from the flash back to the containing page.

Once you are back in the javascript you can use the javascript library that google provides to send custom events and page views back to google analytics.

It s important to distinguish between tracking events (typically a file download, a video being played, etc...) and pageviews. If you want to track navigation within a flash movie between different "pages" of flash content then you will probably want to use:

var pageTracker = _gat._getTracker( UA-XXXXX-X );
pageTracker._trackPageview( /flash/my_first_page );

Note that this will contribute to your overall page views count.

From google:http://code.google.com/apis/analytics/docs/tracking/asyncMigrationExamples.html

Use the _trackPageview() method along with a URL you fabricate in order to track clicks from users that do not lead to actual website pages on your site. In general, we recommend you use Event Tracking for tracking downloads, outbound links, PDFs or similar kinds of user interactions. This is because virtual pageviews will add to your total pageview count. However, if you want to configure goals based on clicks to PDFs or downloads, you need to use this method (but be aware that these clicks will be tallied as part of your overall pageview count).





相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签