Flash :: Way To Implement Google Analytics Tracking?
Jun 1, 2011
I am looking for code, examples, library, components for using google analytics event tracking with my Actionscript 2 Flash movies. I can find info about AS3 on the google code site but not AS2. What is the best resource for tutorials and examples about tagging my Flash files to use the asynch google analytics code. I have found some old information about the old google analytics code.
I've got an AS2 flash movie that I need to add Google Analytics tracking into. The only classes I can find are for AS3, do you know of any class method to track in AS2?
Im completely new to Flash and ActionScript2 but what I need is to add Google analytics code to track clicks from "button" Bellow is a part of my function
We're building a player with the ultimate goal of allowing others to embed our projects (viewed via this player) on their blogs, etc. Currently, I'm adding long-overdue tracking code to the player so we can track people's usage of it.Since Google Analytics tracking requires a javascript function to be embedded on the page along with the swf, and is accessed via an AS ExternalInterface command, what's the best way to handle this when it comes to letting others embed our swf, but still wanting to track?
I'm using Adobe's Google Analytics SWC library for flex. What I'm trying to achieve is to simply be able to utilize the realtime features of Google Analytics to know when users have my AIR desktop application open.Making it detect an open application was easy enough. I can visually see the count on Google Analytics getting updated in a matter of seconds whenever I open up my application. However, the problem occurs when I close my app. Google Analytics doesn't seem to detect a closed app and still detects it as open on the realtime view. How would I go with making Google Analytics know that the application has stopped?
So far, it seems the realtime counter only reverts back to 0 after some 30 or so minutes that I have already closed the app. This leads me to believe that it was considered to be idle by Google and so decided to update the statistics. That might be good and all but I really want to utilize the realtime capability so I need it to reflect when an app closes with only a few seconds of offset.
I am trying to push in the Google Analytics library into my As3 widget. I plan to use the EventTracking feature in addition to the regular HTML-like pageview tracking that it provides. I plan to use the library in As3 mode (not the Bridge mode) since the widget is embedded on a lot of external domains.
Using the SWC to add the component to my project adds about 50k in file size. And my widget in itself is a very painstakingly achieved 120kb. I cannot afford the 50k overhead and every KB trimmed takes me closer to actually using GA with my player.
I got the code down from [URL].. and am trying to figure out any libraries that I can weed out to save file size, yet retain core functionality.
I would like to add Google Analytics to my flash file. The flash file is contained in a HTML file, which I already added the script provided by Google Analytics. At the moment, when a user visits my site, regardless which page is visited, only the homepage is counted.What as3 do I add to the flash file to keep track of each page that is being visited? I've tried a few codes provide on Google Analytics page and other tutorials, but none worked. The as3 for the menu buttons is displayed below.[code]
I make a site in pure as3, i make a swf file. Use swfobject, go to my html doc and make a simple version of the site with html and css as my alternate content. Add my javascript code provided by google analytics. Are the results from google analytics a combination of my html and flash enabled users, or only the html users.
I am trying to set up google analytics for a full flash site.
I added code to the html page and I think it's working properly - to see who is going to my site. But...for more advanced tracking, I think I need to add code to the flash file too.
I got this code to use google analytics to track activity on my flash site but I am not exactly sure on how to use it. Do I place the code on all the buttons I would like to track or is there a way to embed this code into to HTML document that my flash site is embedded in. I figured because of the onRelease action that it needs to be on a button,but I was hoping that there my be a better way. (My flash site has a lot of buttons.)
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?
So I think this question is dumb, and I think I may know the answer already but, I think I may also be very confused, so hear goes. I have a website It is made up of an entire flash site, all in pure AS3, I have the flash component for google analytics, I have events set up all over the file to tell me when things are downloaded, using trackEvent, then all the navigation is all set with trackPageview, so thats all good. If I turn on the debug command and test the file, it tells me what is going on, the only event that fires automatically, is if the user watched the entire intro, it will wait for the intro to finish and track that as an event.
The next part of this site uses swfObject, to allow me to use alternate content. The html side of this site is almost the same as the flash side, it uses all the same event tracking, but no pageview tracking, as from my understanding this is tracked automatically when the user goes from section to section, the analytics code is within the head section. So my question is this. If a user has flash and goes to my site, it should only use the analytical stuff that is in the swf file, correct, however because the analytical data from the html file is in the head of that document, it should also track that at the same time, right. so would this chalk up in my analytics as 1 page visit or 2.
I have been running it this way for a month and the reason I am even questioning it is because, in October 2010 before this was all in place, I only had the analytics set up for the html side, and even that set up did not include any event tracking at all, at this point my analytics was averaging 2500 visits a month with an 83% bounce rate. This was obviously untrue as almost everything was counting as a bounce. Now in January my analytical data is looking very different, my visits are sitting on 5600 and my bounce rate is 39%, I think this is looking much better however I am still concerned because I do not know if I really am getting double the visits, or if the html is adding 1 and the flash is adding another simultaneously.
I'm using the Google Analytics library (AS3 mode) .swc to track some click statistics.Now I'ld like to get the users location. Does anyone know if it's possible to do that with the Flash Google Analytics library?
Just created a new GA account and initialized my tracker in AS3. How can I confirm that it is installed and working correctly? In GA web view it shows "Tracking Not Installed" but when I use the "visualDebug" parameter (set to true) in Flash, it appears to be sending OK via trackEvent. Would it not show up as installed since it's not on the website yet (just testing in IDE)?[code]I'm using the AS3 library in "AS3" mode which sends the requests through a GIF request. This is not using the ga.js library so there's nothing to install on a website.
I have a simple silverlight page for for finding available domain names. This problem is equaly valid for a flash control as well.
I use Google Analytics for monitoring the traffic. I would like to find out how long it take for users to download and render the Silverlight control.
Once the java script on a page is loaded there should be a way to start a timer and then stop the timer once the Silverlight/flash control is loaded. Key points I would like to measure are:
Time it takes to download the silverlight/flash control Time it takes to initialize the control
I'm trying to track a #anchor for example [URL] the anchor is being called by Flash AS2. how can i tell GA to track hits on this page? I tried the GETURL method in flash:
[Code]....
which apprently used to work, but since they've made changes this doesn't... during tests firefox navigated to a page with the url javascript:_gaq.push [URL] was strange. Do I need to even use flash to ask GA to track the anchor? Is there a way i can point GA to track all anchors that are part of my page?
I've got a button in flash that is working just fine. I want to add a tracking function from Google Analytics. The action script on my button is: getStarted_btn.addEventListener(MouseEvent.CLICK, myCanvas);
function myCanvas(e:MouseEvent):void{ navigateToURL(new URLRequest("http://memorialbooks.mycanvas.com/Index.aspx?partnerId=6"),"_blank");}
I have a line of script for that as:
on (release)(getURL("javascript:pageTracker._trackPageview('/caring_cent er/myCanvas_flash.html');"));
I just don't know how to incorporate both. When I add this into it, the buttons don't work any more. how to write the code so that the buttons and tracking both work?
I would like to add Google Analytics to my flash file. The flash file is contained in a HTML file, which I already added the script provided by Google Analytics. At the moment, when a user visits my site, regardless which page is visited, only the homepage is counted.
What as3 do I add to the flash file to keep track of each page that is being visited? I've tried a few codes provide on Google Analytics page and other tutorials, but none worked. The as3 for the menu buttons is displayed below.
So I would like to include pageTracker code in the iFrames that is being called.However the iFrames in this case are called from Flex. We are building a pop up and calling the iframes within the pop up.
In this scenario, what is the best way to include the pageTracker code to track and trasnfer the visitor and campaign cookies from one domain to the next?
I want to use Google Analytics on my Vkontakte application (written with Flex). Vkontakte does not support naturally in Google Analytics (not as Facebook) which means I can't even put the Google Analytics JS at the bottom of the page (or even use JS for that matter). What I can use is the AS3 library of Google Analytics, but for some reason it reports of failed gif requests every time I use it to report on an event. Is it even possible to use Google Analytics on the described environment? If so, what could be the reason of the failed gif requests? Is it debugable?
I'm using Google analytics in my flash app. It works perfectly, but the time to publich the app came and I'm using an external swf. as preloader, which only consists in an small progress bar and summons my Flash app once it's completely loaded.Now i'm getting this error:Error #1009: Error #1009: Cannot access a property or method of a null object
at com.google.analytics.core::IdleTimer() at com.google.analytics::GATracker/_trackerFactory() at com.google.analytics::GATracker/_factory()
I'm using the asdoc.exe program that came with Flex Builder 3 to generate documentation for FlashMOG. I want to put in my google analytics javascript before the closing body tag of each file. Is there some way to get asdoc to do this?
I have an as2 site that calls different swfs to the stage from movieclips.The buttons are movieclips and the content that is pulled in is a different swf for each button.How would I go about integrating SWFaddress in here and being able to get analytics functionality out of it?
I'm have some videos and I would like to add analytics so I can track how many times they were played. Although it sounds like a simple task, I can't seem to find much on the subject.
I am attempting to add google analytics tracking to an Adobe Air app created with HTML and javascript.I have tried adding the ga.js file and using it like I would in a webpage:
But this doesn't seem to register anything on the analytics dashboard.Have also tried using the GA for flash actionscript library but I can't seem to create an instance of the GATracker as it needs a DisplayObject?
EDIT :using the information from grapefrukt I tried the following:
air.Sprite = window.runtime.flash.display.Sprite; air.GATracker = window.runtime.com.google.analytics.GATracker; var tracker = new air.GATracker( new air.Sprite(), "UA-XXXXXXX-X", "AS3", false );
but I get the following error:TypeError: Error #1009: Cannot access a property or method of a null object reference