<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>zedia flash blog &#187; Google Analytics</title>
	<atom:link href="http://www.zedia.net/tag/google-analytics/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zedia.net</link>
	<description>Flash, ActionScript, SEO and everything in between</description>
	<lastBuildDate>Wed, 21 Jul 2010 17:07:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Analytics for Mobile Applications : a good idea, six months too late</title>
		<link>http://www.zedia.net/2010/analytics-for-mobile-applications-a-good-idea-six-months-too-late/</link>
		<comments>http://www.zedia.net/2010/analytics-for-mobile-applications-a-good-idea-six-months-too-late/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 18:36:07 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Analytics]]></category>
		<category><![CDATA[Flurry]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Applications]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=540</guid>
		<description><![CDATA[So yesterday I was talking with my friend that does iPhone applications about what data he gets from Apple about the applications he builds. It turns out that aside from the number of sales, he doesn&#8217;t have any data. I found this weird and we started talking about how it wouldn&#8217;t be that hard to [...]]]></description>
			<content:encoded><![CDATA[<p>So yesterday I was talking with my friend that does iPhone applications about what data he gets from Apple about the applications he builds. It turns out that aside from the number of sales, he doesn&#8217;t have any data. I found this weird and we started talking about how it wouldn&#8217;t be that hard to build a kind of <a title="Google Analytics" href="http://www.google.com/analytics/" target="_blank">Google Analytics</a> for Mobile Applications. In a sense, it would be very similar to the library <a title="Google Analytics for Flash" href="http://code.google.com/p/gaforflash/" target="_blank">GA for Flash</a> except that you build a library for every Mobile SDK plus you have a webserver where the data is analysed.</p>
<p>It took so much time for a library of analytics to be made for Flash, I thought there might be a chance that nobody did anything like this for mobiles. So we got all excited (like so many other time), we started thinking how we would build this. But today I searched on the web and found <a title="Flurry" href="http://www.google.ca/search?rlz=1C1GGLS_enCA366&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=flurry+analytics">Flurry</a> a company that has an analytics division that does exactly this. Well not exactly how I would do it but about 85% the same. So my bubbles is a bit busted.</p>
<p>Flurry does it mostly right but their interface is a bit complicated and they didn&#8217;t make their analytics that specific to mobiles. There are plenty of concepts that exist in the mobile world that are new: what people do in their first and last run of the application, the number of tap (click with fingers) by session, the accelerometer, etc. And they don&#8217;t track that, yet. Also they provide an  API for events, but not for navigation (pageViews in the GA world). I think navigation still has an important role in the analytics of an application than in the analytics of a website. You want to know what the users did in a certain section of your app (how many taps in the help section for example).</p>
<p>So all of that could be implemented and would give a better service than what Flurry is offering. The problem is that their platform is already built and even if there is not much competition (they seem to be the only ones doing this), it would still be hard to beat their momentum.</p>
<p>So what do you think? Should I invest time in this project knowing these risks, or should I let this go and wait for another idea?</p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2010%2Fanalytics-for-mobile-applications-a-good-idea-six-months-too-late%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2010/analytics-for-mobile-applications-a-good-idea-six-months-too-late/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I am now Google Analytics Qualified</title>
		<link>http://www.zedia.net/2009/i-am-now-google-analytics-qualified/</link>
		<comments>http://www.zedia.net/2009/i-am-now-google-analytics-qualified/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 20:12:17 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Adwords]]></category>
		<category><![CDATA[GA Individual Qualification]]></category>
		<category><![CDATA[GA IQ test]]></category>
		<category><![CDATA[Google Analytics IQ]]></category>
		<category><![CDATA[Google Analytics Qualified]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=497</guid>
		<description><![CDATA[Well since last week and I got a whooping score. You might ask why I spent time to do this certification (Google Analytics Individual Qualification test), well, I think it is better to have more than one tool in your pocket and it also shows that you think of the big picture and not just [...]]]></description>
			<content:encoded><![CDATA[<p>Well since last week and I got a <a title="Google Analytics IQ test score" href="http://www.starttest.com/8.0.0.0/transcriptview.aspx?r=1&amp;code=I0069EF64F876EC7BFE65E871F9790D89ADB9" target="_blank">whooping score</a>. You might ask why I spent time to do this certification (Google Analytics Individual Qualification test), well, I think it is better to have more than one tool in your pocket and it also shows that you think of the big picture and not just about code. Analytics is also a very in demand skill along with Flash and SEO so it could not hurt. I didn&#8217;t know if I truly used GA correctly, now I guess this says I&#8217;m not so bad at it.</p>
<p><img class="aligncenter size-full wp-image-498" title="gaCertificate" src="http://www.zedia.net/wp-content/uploads/2009/11/gaCertificate.jpg" alt="gaCertificate" width="500" height="386" /></p>
<p>Here are a couple of tips to help yourself on the test: first I hope you have played a bit with Google Analytics that will help a great deal! Secondly whatch all the videos in the <a title="Conversion University" href="http://www.google.com/support/conversionuniversity/?hl=en" target="_blank">conversion university</a>. Not only do they help a great deal for the test, but they are very instructive and well done. Having knowledge of Adwords will also help a lot since a third of the questions will be on the topic of integration of Adwords and Google Analytics (some plainly on Adwords!!).</p>
<p>Go get certified now while I look for synonyms for the word &#8220;also&#8221;.</p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2009%2Fi-am-now-google-analytics-qualified%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2009/i-am-now-google-analytics-qualified/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My article on Google Analytics for Flash in FFDMag</title>
		<link>http://www.zedia.net/2009/my-article-on-google-analytics-for-flash-in-ffdmag/</link>
		<comments>http://www.zedia.net/2009/my-article-on-google-analytics-for-flash-in-ffdmag/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 02:47:33 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Action]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Event tracking]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=446</guid>
		<description><![CDATA[I wrote this a couple months back for FFDMag and now that some time has passed I thought it would be a good idea to also post it on my blog and get some Google juice for the work that I put into it. So here it is: In this time of economic crisis, marketing [...]]]></description>
			<content:encoded><![CDATA[<p><em>I wrote this a couple months back for <a title="FFDMag" href="http://www.ffdmag.com/" target="_blank">FFDMag</a> and now that some time has passed I thought it would be a good idea to also post it on my blog and get some Google juice for the work that I put into it. So here it is:</em></p>
<p>In this time of economic crisis, marketing budgets are shifting from traditional to digital because of the later&#8217;s ability to provide data about its effects. Flash has never been great at web analytics, but a new library, Google Analytics for Flash, is going to change this. This article will focus on how to install this library, how to use it and will explain some of its key concepts.</p>
<h3><strong>Installation</strong></h3>
<p>Well the first thing to do before getting started is to install the library. This might not be as obvious as it should be so I thought it would be good to explain it here. When you download the zip file from the Google Code page for <a title="Google Analytics For Flash" href="http://code.google.com/p/gaforflash/" target="_blank">Google Analytics for Flash</a>, what you&#8217;ll get in it is two SWC files. Now SWC files are a common thing in the Flex world, but they are not so common in the Flash world. This is where the difficulty lies.</p>
<h3><strong>Flash CS4</strong></h3>
<p>There is a new feature in Flash CS4 that enables you to import SWC libraries a bit in the way that you would do it in Flex. All you have to do is open the publish profile and click on the Flash tab. Now click on the Actionscript 3 settings; on the window that will pop-up you will see a red envelope icon, clicking on this will enable you to import the SWC file.</p>
<p style="text-align: center;"><img class="size-full wp-image-451 aligncenter" title="screenshot1" src="http://www.zedia.net/wp-content/uploads/2009/09/screenshot11.jpg" alt="screenshot1" width="446" height="670" /></p>
<h3><strong>Flash CS3</strong></h3>
<p>Now it ain&#8217;t that easy for Flash developers still using Flash CS3 (the majority of them I guess). I have found two ways of getting the same results.</p>
<p>First you could use a Subversion client like TurtleSVN to checkout(download) the source code of the library. This will give you access to the Actionscript files (.as) that were used to make the SWC library. Once you have those files just copy them in your project directory and you&#8217;re ready to go.</p>
<p>If you don&#8217;t want to bother with svn, you can copy the SWC files in the Component directory of your Flash installation. Now this is the intended use of the SWC files by the makers, but I found it is more complicated than it should have been. If you want to do it that way copy the SWC files in the following folder in windows:</p>
<p>C:\Program Files\Adobe\Adobe Flash CS3\language\Configuration\Components</p>
<p>And the following folder if you are using a Mac:</p>
<p>Macintosh HD:Applications:Adobe Flash CS3:Configuration:Components</p>
<p>The next time you will start Flash, in your component window, you should see the Google Analytics for Flash components. Drag the component in the library and you can go on to the next step.</p>
<p style="text-align: center;"><img class="size-full wp-image-450 aligncenter" title="screenshot2" src="http://www.zedia.net/wp-content/uploads/2009/09/screenshot2.jpg" alt="screenshot2" width="232" height="358" /></p>
<h3><strong>On to tracking</strong></h3>
<p>Tracking is the easiest part of the process and is fairly intuitive. You have to do a bit more work than you would with an HTML website, but in the end you gain more control.</p>
<p>All you have to do is import the library and create the tracker this way:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">google</span>.<span style="color: #006600;">analytics</span>.<span style="color: #006600;">AnalyticsTracker</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">google</span>.<span style="color: #006600;">analytics</span>.<span style="color: #006600;">GATracker</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> _tracker:AnalyticsTracker = <span style="color: #000000; font-weight: bold;">new</span> GATracker<span style="color: #66cc66;">&#40;</span> main, <span style="color: #ff0000;">&quot;UA-7777777-7&quot;</span>, <span style="color: #ff0000;">&quot;AS3&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The first parameter in this case refers to a DisplayObject on the stage or the stage itself. The second parameter is the id for the Google Analytics profile you want the data to be sent to. The third parameter is the mode in which the tracker will function, in this case AS3 mode. An other mode that the tracker can be set to is the Bridge mode; I&#8217;ll discuss the difference between the two modes later on.</p>
<p>You are now ready to track. The tracker you just created will give you access to two method of tracking: tracking pages and tracking events.</p>
<p>For pages, you can clearly grasp the concept when you think of an HTML website. Each time the browser will refresh or change a page and that page is from your website, a pageview is sent to Google Analytics. Now you can translate the same concept to Flash and rich internet applications, but those tends to have less pages than HTML websites. When I try to define pages in my Flash website, I try to think in sections, example: the contact section, the home section, the help section etc.</p>
<p>Here is the code you would write to track a pageview:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">_tracker.<span style="color: #006600;">trackPageview</span><span style="color: #66cc66;">&#40;</span>yourSectionName + <span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Events are a metric that is more suited to Flash and RIA than pageViews. Event tracking is still in beta so it is not enabled on all profiles. You can ask Google to activate events on your account by filling the form found on this page:</p>
<p><a title="Event tracking request" href="http://code.google.com/p/gaforflash/wiki/EventTrackingRequest" target="_blank">http://code.google.com/p/gaforflash/wiki/EventTrackingRequest</a>.</p>
<p>Events are best suited to track user&#8217;s interaction with your project: how many user fully saw your video, how many clicked on the mute sound button, etc.</p>
<p>This is what you would write to send and event:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">_tracker.<span style="color: #006600;">trackEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;English&quot;</span>, <span style="color: #ff0000;">&quot;Client Satisfaction&quot;</span>, <span style="color: #ff0000;">&quot;Question 3&quot;</span>, value<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The trackEvent funciton can take up to 4 parameters, the last two being optional. They are in order Category, Action, Label and Value and are all Strings except the last one that has to be a non-negative integer. Google Analytics suggest some use of these parameters, but in the end, it&#8217;s up to you to decide how you want to define them. More information about Events here:</p>
<p><a title="Event tracking guide" href="http://code.google.com/apis/analytics/docs/eventTrackerGuide.html" target="_blank">http://code.google.com/apis/analytics/docs/eventTrackerGuide.html</a></p>
<h3><strong>Bridge vs AS3</strong></h3>
<p>I have only talked about the AS3 mode so far because it is the one I use more often. It is mostly used when you&#8217;re entire site is made in Flash or also when your content will be embedded somewhere you don&#8217;t have access to the HTML. This is the case for widget and games that are embedded on multiple sites.</p>
<p>As for Bridge mode there is two cases where I would use it. First if your Flash is just a part of a bigger website done in HTML that already uses Google Analytics, then using Bridge mode will use the tracker of the html page blending in the data of the Flash content with the rest. Secondly, not all of the Google Analytics API is available using AS3 mode so if you need advanced functions or ones that are not enabled than you have no choices but to use Bridge mode. The code is a bit different from AS3 mode so I&#8217;m going to provide a sample:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> _tracker:AnalyticsTracker = <span style="color: #000000; font-weight: bold;">new</span> GATracker<span style="color: #66cc66;">&#40;</span> main, <span style="color: #ff0000;">&quot;window.PageTracker&quot;</span>, <span style="color: #ff0000;">&quot;Bridge&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The first parameter in this case still refers to a DisplayObject on the stage. The second one has to be the name of your Javascript PageTracker Object preceded by &#8220;window.&#8221; and the last one is to tell the tracker to be in Bridge mode. Since, Flash will need to communicate with the javascript while in Bridge mode, you have to be sure that allowScriptAccess is set to always in the html page that embeds the Flash content.</p>
<h3><strong>Visual Debug</strong></h3>
<p>One cool thing about GA for Flash is the Visual Debug. All you have to do to enable it is add an extra parameter when you initialize the tracker.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> _tracker:AnalyticsTracker = <span style="color: #000000; font-weight: bold;">new</span> GATracker<span style="color: #66cc66;">&#40;</span> main, <span style="color: #ff0000;">&quot;UA-7777777-7&quot;</span>, <span style="color: #ff0000;">&quot;AS3&quot;</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Doing this will add a layer on top of your application where all the actions the tracker performs will be listed.</p>
<p style="text-align: center;"><img class="size-full wp-image-448 aligncenter" title="screenshot3" src="http://www.zedia.net/wp-content/uploads/2009/09/screenshot3.jpg" alt="screenshot3" width="536" height="387" /></p>
<p>What is neat about this is that you can now see instantly what you are tracking. With the javascript API, it is hard to see exactly what you are sending because you have to note down what you did and go check 4-5 hours later to see if tracked correctly (Google Analytics shows data after a delay of a few hours). With the Visual Debug you can see if you are sending more events than you should or if one label is misspelled etc.</p>
<p>Even if Google Analytics for Flash is a great library, it has some drawbacks, the biggest one being that it will add 40k to the size of your Flash content. But even with that in mind, I think it is worth using in every Flash project. Go on, get tracking!</p>
<h3><strong>Ressources</strong></h3>
<p><strong>Google Code:</strong></p>
<p><a title="Google Analytics For Flash" href="http://code.google.com/p/gaforflash/" target="_blank">http://code.google.com/p/gaforflash/</a></p>
<p><strong>Developer group:</strong></p>
<p><a title="Developer group" href="http://groups.google.com/group/ga-for-flash?pli=1" target="_blank">http://groups.google.com/group/ga-for-flash?pli=1</a></p>
<p><strong>Adobe Max presentation on Google Analytics for Flash:</strong></p>
<p><a title="Adobe Max presentation" href="http://tv.adobe.com/#vi+f15385v1040" target="_blank">http://tv.adobe.com/#vi+f15385v1040</a></p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2009%2Fmy-article-on-google-analytics-for-flash-in-ffdmag%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2009/my-article-on-google-analytics-for-flash-in-ffdmag/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to connect to Google Analytics Data API in AIR</title>
		<link>http://www.zedia.net/2009/how-to-connect-to-google-analytics-data-api-in-air/</link>
		<comments>http://www.zedia.net/2009/how-to-connect-to-google-analytics-data-api-in-air/#comments</comments>
		<pubDate>Fri, 22 May 2009 03:37:38 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[as3corelib]]></category>
		<category><![CDATA[as3crypto]]></category>
		<category><![CDATA[as3httpclientlib]]></category>
		<category><![CDATA[GData]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Google Analytics Data Api]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=415</guid>
		<description><![CDATA[I had a bit of trouble doing just this a while ago, ended up trying many different ways and finally a reader of this blog, Nakamachi, gave me the solution. Because I think many of you are trying to connect to Google Analytics Data API ( or any Google APIs for that matters) I will [...]]]></description>
			<content:encoded><![CDATA[<p>I had a bit of trouble doing <a title="Connecting to Google Analytics Data Api using AS3; my failures" href="http://www.zedia.net/2009/connecting-to-google-analytics-data-api-using-as3-my-failures/" target="_self">just this a while ago</a>, ended up trying many different ways and finally a reader of this blog, <span class="info">Nakamachi, gave me the solution. Because I think many of you are trying to connect to Google Analytics Data API ( or any Google APIs for that matters) I will give you here my solution. My solution only works in AIR; I don&#8217;t know why, but as soon as I put it on the web, it stops working. I have found a solution for that problem too but I will keep it for another post.</span><br />
Here is how you can connect to GData:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> org.<span style="color: #006600;">httpclient</span>.<span style="color: #006600;">HttpClient</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">adobe</span>.<span style="color: #006600;">net</span>.<span style="color: #006600;">URI</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">httpclient</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">HttpResponseEvent</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">httpclient</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">HttpRequestEvent</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">httpclient</span>.<span style="color: #006600;">HttpRequest</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">httpclient</span>.<span style="color: #006600;">http</span>.<span style="color: #0066CC;">Get</span>;
<span style="color: #0066CC;">import</span> org.<span style="color: #006600;">httpclient</span>.<span style="color: #006600;">events</span>.<span style="color: #006600;">HttpDataEvent</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> _firstBuffer:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
<span style="color: #000000; font-weight: bold;">var</span> _secondBuffer:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//this first connection will get the authorization token by sending the user name and password for Google Analytics</span>
<span style="color: #000000; font-weight: bold;">function</span> submitForm<span style="color: #66cc66;">&#40;</span>email:<span style="color: #0066CC;">String</span>, <span style="color: #0066CC;">password</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">var</span> client:HttpClient = <span style="color: #000000; font-weight: bold;">new</span> HttpClient<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #000000; font-weight: bold;">var</span> uri:URI = <span style="color: #000000; font-weight: bold;">new</span> URI<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;https://www.google.com/accounts/ClientLogin&quot;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #000000; font-weight: bold;">var</span> variables:<span style="color: #0066CC;">Array</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">name</span>:<span style="color: #ff0000;">&quot;accountType&quot;</span>, value:<span style="color: #ff0000;">&quot;GOOGLE&quot;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">name</span>:<span style="color: #ff0000;">&quot;Email&quot;</span>, value: email<span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">name</span>:<span style="color: #ff0000;">&quot;Passwd&quot;</span>, value: <span style="color: #0066CC;">password</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">name</span>:<span style="color: #ff0000;">&quot;service&quot;</span>, value: <span style="color: #ff0000;">&quot;analytics&quot;</span><span style="color: #66cc66;">&#125;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #0066CC;">name</span>:<span style="color: #ff0000;">&quot;source&quot;</span>, value: <span style="color: #ff0000;">&quot;your-application-identifier&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#93;</span>;
  client.<span style="color: #006600;">listener</span>.<span style="color: #0066CC;">onData</span> = _onFirstData;
  client.<span style="color: #006600;">listener</span>.<span style="color: #006600;">onComplete</span> = _onLoaderComplete;
  client.<span style="color: #006600;">postFormData</span><span style="color: #66cc66;">&#40;</span>uri, variables<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> _onFirstData<span style="color: #66cc66;">&#40;</span>event:HttpDataEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
  _firstBuffer += event.<span style="color: #006600;">readUTFBytes</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//this second connection will request information to GData</span>
<span style="color: #808080; font-style: italic;">//in this case account info for Google Analytics by</span>
<span style="color: #808080; font-style: italic;">//putting the auth token in the header of the request</span>
<span style="color: #000000; font-weight: bold;">function</span> _onLoaderComplete<span style="color: #66cc66;">&#40;</span>event:HttpResponseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">var</span> tempArray:<span style="color: #0066CC;">Array</span> = _firstBuffer.<span style="color: #0066CC;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Auth=&quot;</span><span style="color: #66cc66;">&#41;</span>;
 <span style="color: #000000; font-weight: bold;">var</span>  _authToken:<span style="color: #0066CC;">String</span> = <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span>tempArray<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
  <span style="color: #000000; font-weight: bold;">var</span> client:HttpClient = <span style="color: #000000; font-weight: bold;">new</span> HttpClient<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #000000; font-weight: bold;">var</span> uri:URI = <span style="color: #000000; font-weight: bold;">new</span> URI<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;https://www.google.com/analytics/feeds/accounts/default&quot;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #000000; font-weight: bold;">var</span> request:HttpRequest = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Get</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  request.<span style="color: #006600;">addHeader</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Authorization&quot;</span>, <span style="color: #ff0000;">&quot;GoogleLogin auth=&quot;</span> + _authToken<span style="color: #66cc66;">&#41;</span>;
&nbsp;
  client.<span style="color: #006600;">listener</span>.<span style="color: #0066CC;">onData</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>event:HttpDataEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
    _secondBuffer += event.<span style="color: #006600;">readUTFBytes</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
  client.<span style="color: #006600;">listener</span>.<span style="color: #006600;">onComplete</span> = _onSecondLoaderComplete;
  client.<span style="color: #006600;">request</span><span style="color: #66cc66;">&#40;</span>uri, request<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> _onSecondLoaderComplete<span style="color: #66cc66;">&#40;</span>event:HttpResponseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">trace</span> <span style="color: #66cc66;">&#40;</span>_secondBuffer<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>As you can see in order to circumvent the Authorization header restriction I am using the <a title="as3httpclientlib" href="http://code.google.com/p/as3httpclientlib/">as3httpclientlib</a> library which requires the <a title="as3corelib" href="http://code.google.com/p/as3corelib/" target="_blank">as3corelib</a> and <a title="as3crypto" href="http://code.google.com/p/as3crypto/" target="_blank">as3crypto</a> libraries to compile. Using the same principle you should be able to connect to Google APIs from your AIR application.</p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2009%2Fhow-to-connect-to-google-analytics-data-api-in-air%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2009/how-to-connect-to-google-analytics-data-api-in-air/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>More about Google Analytics for Flash</title>
		<link>http://www.zedia.net/2008/more-about-google-analytics-for-flash/</link>
		<comments>http://www.zedia.net/2008/more-about-google-analytics-for-flash/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 18:14:00 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Event tracking]]></category>
		<category><![CDATA[GATracker]]></category>
		<category><![CDATA[Google Analytics for Flash]]></category>
		<category><![CDATA[Twist Image Holiday card : It's a wonderful life]]></category>

		<guid isPermaLink="false">http://www.zedia.net/?p=215</guid>
		<description><![CDATA[I know I have been bad mouthing (see comments) a bit on Google Analytics for Flash, but it is mostly because I expect great things from that library and I have been wanting it for a long time. Last week I have been playing around with the API and there is a couple of findings [...]]]></description>
			<content:encoded><![CDATA[<p>I know I have been <a title="Why Google Analytics for flash" href="http://jessewarden.com/2008/12/why-google-analytics-for-flash.html" target="_blank">bad mouthing (see comments)</a> a bit on <a title="Google Analytics for Flash" href="http://code.google.com/p/gaforflash/" target="_blank">Google Analytics for Flash</a>, but it is mostly because I expect great things from that library and I have been wanting it for a long time. Last week I have been playing around with the API and there is a couple of findings I wanted to share with you.</p>
<p>First off, the library only works for Actionscript 3, which is not a big concern to me because I hope I will only be doing Actionscript 3 projects from now on. Also, when you include the library (at least in AS3 mode, haven&#8217;t tested in bridge mode) it will add about 40k to your file size. This is not so bad, but not so good at the same time. Making this smaller could make it accessible for a broader range of projects. Also I tried to import both the SWC you find on the download from Google code, but none of them would work; Flash would complain about not being able to import them. I finally circumvented that problem by checking out the source code using SVN.</p>
<p>Once you&#8217;re set up, one off the coolest things you can do is set the tracker to debug mode; it gives you some insights about what is going on under the hood. But for those of you who don&#8217;t want to go through all that trouble I just posted it down here:</p>
<p><object width="550" height="400" data="http://www.zedia.net/flash/testEvents.swf" type="application/x-shockwave-flash"><param name="src" value="http://www.zedia.net/flash/testEvents.swf" /></object></p>
<p>Here is the Actionscript 3 code I used to make my test:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">google</span>.<span style="color: #006600;">analytics</span>.<span style="color: #006600;">AnalyticsTracker</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">google</span>.<span style="color: #006600;">analytics</span>.<span style="color: #006600;">GATracker</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> tracker:AnalyticsTracker;
&nbsp;
tracker = <span style="color: #000000; font-weight: bold;">new</span> GATracker<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;UA-639032-8&quot;</span>, <span style="color: #ff0000;">&quot;AS3&quot;</span>, <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
button1.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;
button2.<span style="color: #006600;">buttonMode</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
button1.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, _onBut1Down, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
button2.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_DOWN</span>, _onBut2Down, <span style="color: #000000; font-weight: bold;">false</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> _onBut1Down<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	tracker.<span style="color: #006600;">trackPageview</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;/test1&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> _onBut2Down<span style="color: #66cc66;">&#40;</span>event:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	tracker.<span style="color: #006600;">trackEvent</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;say&quot;</span>, <span style="color: #ff0000;">&quot;hello world&quot;</span>, <span style="color: #ff0000;">&quot;test&quot;</span>, <span style="color: #cc66cc;">123</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>In this code, the fourth parameter in the constructor of the GATracker object is the debug parameters, setting it to true will enable this view.</p>
<p>My main goal for making this was because I had read that in <a title="Google Analytics does better Flash tracking" href="http://zehfernando.com/2008/google-analytics-does-better-flash-tracking/" target="_blank">AS3 mode you could track events</a> yet (check in the comments). So I created a new profile in my <a title="Google Analytics" href="http://www.google.com/analytics/" target="_blank">GA</a> account for testing purpose and set all this up, but the major problem was that not all profile get event tracking activated.  Actually, I have written a post about <a title="Google Analytics event tracking is out" href="http://www.zedia.net/2008/i-got-a-scoop-google-analytics-events-are-out/" target="_self">event tracking being out</a>, but my guess is that Google is extending the beta (Google sure does love betas) to more accounts and that mine was one of them. But even if your account has been activated for event tracking, newly created profiles won&#8217;t be activated.</p>
<p>So I had some test running but no way to check the results. That was true until I found this hidden gem (I am probably shooting myself in the foot right now and should keep this a secret but hey!) in the midst of the Google code website for Google Analytics for Flash :<a title="Activate event tracking in Google Analytics" href="http://code.google.com/p/gaforflash/wiki/EventTrackingRequest" target="_blank"> A request form to activate event tracking</a> on certain profile of a Google Analytics account. I did so, and three days later I could see the results of my tests. Event tracking was working just fine in AS3 mode. The form says that they will accept 500 requests so you better get profiles activated if you plan on using it. But even if your account is not activated Google will still record the events; it&#8217;s just that you won&#8217;t be able to see the results until it is activated. We have some projects that fall in that category; mostly the <a title="Twist Image | It's a wonderfull life" href="http://www.twistimage.com/itsawonderfullife/" target="_blank">Twist Image Holiday card : It&#8217;s a wonderful life</a> (shameless plug). We hope event tracking gets out of beta really soon!</p>
<p>Well that&#8217;s about it, see you tomorrow as I try to complete this week of post every day.</p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2008%2Fmore-about-google-analytics-for-flash%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2008/more-about-google-analytics-for-flash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Analytics For Flash; is it that usefull?</title>
		<link>http://www.zedia.net/2008/google-analytics-for-flash-is-it-that-usefull/</link>
		<comments>http://www.zedia.net/2008/google-analytics-for-flash-is-it-that-usefull/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 00:16:06 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://www.zedia.net/2008/google-analytics-for-flash-is-it-that-usefull/</guid>
		<description><![CDATA[Not too long ago Google released Google Analytics for Flash. My first reaction was one of happiness; finally some attention would be put into Flash analytics. But after looking into it a bit more I found out that Google Analytics for Flash wasn&#8217;t such a big deal. On Google Analytics side, nothing changed; no specific [...]]]></description>
			<content:encoded><![CDATA[<p>Not too long ago Google released <a title="Google analytics for flash" href="http://code.google.com/p/gaforflash/" target="_blank">Google Analytics for Flash</a>. My first reaction was one of happiness; finally some attention would be put into Flash analytics. But after looking into it a bit more I found out that Google Analytics for Flash wasn&#8217;t such a big deal.</p>
<p>On Google Analytics side, nothing changed; no specific stats just for Flash,  just the good old interface we all know.  On the Flash side, nothing changed much there either; instead of doing this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">&nbsp;
ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;pageTracker._trackPageview('/somepage');&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>You now do this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">tracker = <span style="color: #000000; font-weight: bold;">new</span> GATracker<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;window.PageTracker&quot;</span>, <span style="color: #ff0000;">&quot;Bridge&quot;</span>, <span style="color: #000000; font-weight: bold;">false</span> <span style="color: #66cc66;">&#41;</span>;
tracker.<span style="color: #006600;">trackPageview</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;/somepage&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>From the look of it, it&#8217;s actually more code than before.</p>
<p>The cool thing about GA for Flash is the ActionScript 3 mode. In that mode, you can call the tracker even if the JavaScript code wasn&#8217;t imported in the HTML page the Flash file is embedded. Now that is a possibility that we didn&#8217;t have before. So in a context where you do not have control over the HTML you flash will be embedded, this will enable you to do analytics just the same. I have also seen in the road map for the project that they want to implement it for Adobe AIR also; this will be very useful.</p>
<p><strong>What will you be using Google Analytics for Flash for? </strong></p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2008%2Fgoogle-analytics-for-flash-is-it-that-usefull%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2008/google-analytics-for-flash-is-it-that-usefull/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>I got a scoop; Google Analytics Events are out!</title>
		<link>http://www.zedia.net/2008/i-got-a-scoop-google-analytics-events-are-out/</link>
		<comments>http://www.zedia.net/2008/i-got-a-scoop-google-analytics-events-are-out/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 05:29:38 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Event tracking]]></category>
		<category><![CDATA[pageTracker._trackEvent]]></category>

		<guid isPermaLink="false">http://www.zedia.net/2008/i-got-a-scoop-google-analytics-events-are-out/</guid>
		<description><![CDATA[Don&#8217;t know about bloggers not being journalists and all but I sure feel like one with this premium scoop. Google released today a forum for their analytic counterpart and I had already a question waiting for them: Why with all the documentation being available about it since at least February haven&#8217;t you released the Event [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t know about bloggers not being journalists and all but I sure feel like one with this premium scoop.</p>
<p>Google released today a <a href="http://www.google.com/support/forum/p/Google+Analytics/" title="Google Analytics Forum" target="_blank">forum</a> for their analytic counterpart and I had already a question waiting for them: Why with all the <a href="http://code.google.com/apis/analytics/docs/eventTrackerGuide.html" title="GA event tracking documentation" target="_blank">documentation</a> being available about it since at least February haven&#8217;t you released the Event tracking? But before you ask a question like that, with that tone, you check what you are asking. So I go in my Google Analytics account and under the Content section there it was, just lying there, waiting for me to discover it : Event Tracking (don&#8217;t know if this has been released officially, but I have seen it on 2 different GA account so far).</p>
<p><strong>What&#8217;s up with all this fuss? We could already somehow track events using pageTracker._trackPageview.</strong></p>
<p>You are right, but being able to track events as a separate thing than a pageview is really important.  Not that much for a website completely made in Flash with only one HTML page, but for anything else, it sure is important. You see, when you use pageTracker._trackPageview to track events, the statistics you gather that way counts as pageviews while they are not really, so it kinda skews all your results. You can still draw conclusions from them, but it is not as precise.</p>
<p>With pageTracker._trackEvent, there is a distinction between event and pageview so it doesn&#8217;t skew your data. Plus the _trackEvent methodhas 4 parameters giving you more options about what you want to track.These parameters are the category, the action, the label and the value; more informations about them in <a href="http://code.google.com/apis/analytics/docs/eventTrackerGuide.html" title="Google Analytics Event Tracking Documentation" target="_blank">Google&#8217;s documentation</a>.</p>
<p>There are tons of stuff that would be appropriate to track with events like the answer of a quiz, which track in your MP3 player is most played etc. For Flash, any action you want to track and is not really a page can be tracked that way. You could have done that before using a database and server-side scripting, but it is much more convient to not have to bother with that and to have all your stats in one single place.</p>
<p><strong>I am going tracking this minute. What are you going to track?</strong></p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2008%2Fi-got-a-scoop-google-analytics-events-are-out%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2008/i-got-a-scoop-google-analytics-events-are-out/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SWFAddress 2.1 and the new Google Analytics Tracker</title>
		<link>http://www.zedia.net/2008/swfaddress-21-and-the-new-google-analytics-tracker/</link>
		<comments>http://www.zedia.net/2008/swfaddress-21-and-the-new-google-analytics-tracker/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 22:49:19 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[SWFAddress]]></category>
		<category><![CDATA[ga.js]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Urchin]]></category>

		<guid isPermaLink="false">http://www.zedia.net/2008/swfaddress-21-and-the-new-google-analytics-tracker/</guid>
		<description><![CDATA[I had made a previous post about how to integrate the new Google Analytics Tracker and SWFAddress. It wasn&#8217;t obvious but it was fairly easy. I guess people really asked for an even easier way to do it because the new javascript code(ga.js) now works with SWFAddress without indicating to it that you are not [...]]]></description>
			<content:encoded><![CDATA[<p>I had made a previous post about <a href="http://www.zedia.net/2008/swfaddress-and-the-new-google-analytics-gajs/" title="SWFAddress and ga.js" target="_blank">how to integrate the new Google Analytics Tracker and SWFAddress</a>. It wasn&#8217;t obvious but it was fairly easy. I guess people really asked for an even easier way to do it because the new javascript code(ga.js) now works with SWFAddress without indicating to it that you are not using the Urchin tracker. As a matter of fact, with the release of SWAddress 2.1 earlier this week, the support for the ga.js tracker is one of the update. Other updates include a lot of fixes for the SEO examples and also the AS2 and AS3 classes are now in the com.asual.swfaddress.</p>
<p>I really have to look into the SEO  example that was released along version 2.0. It is one of my goal for the next month along to getting to know PureMVC better.</p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2008%2Fswfaddress-21-and-the-new-google-analytics-tracker%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2008/swfaddress-21-and-the-new-google-analytics-tracker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWFAddress and the new Google Analytics (ga.js)</title>
		<link>http://www.zedia.net/2008/swfaddress-and-the-new-google-analytics-gajs/</link>
		<comments>http://www.zedia.net/2008/swfaddress-and-the-new-google-analytics-gajs/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 02:29:57 +0000</pubDate>
		<dc:creator>zedia.net</dc:creator>
				<category><![CDATA[SWFAddress]]></category>
		<category><![CDATA[ga.js]]></category>
		<category><![CDATA[Google Analytics]]></category>
		<category><![CDATA[Urchin]]></category>

		<guid isPermaLink="false">http://www.zedia.net/2008/swfaddress-and-the-new-google-analytics-gajs/</guid>
		<description><![CDATA[I&#8217;m always playing a bit with SWFAddress, SWFObject and Google Analytics. SWFAddress has a nice features which is that it will advise Google Analytics when you change a page inside your main swf movie. That gives you the ability to do tracking on your website. Pretty neat! Has some of you might know, Google Analytics [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m always playing a bit with <a href="http://www.asual.com/swfaddress/" title="SWFAddress" target="_blank">SWFAddress</a>, <a href="http://blog.deconcept.com/swfobject/" title="SWFObject" target="_blank">SWFObject</a> and <a href="http://www.google.com/analytics/" title="Google Analytics" target="_blank">Google Analytics</a>. <a href="http://www.asual.com/swfaddress/" title="SWFAddress" target="_blank">SWFAddress</a> has a nice features which is that it will advise <a href="http://www.google.com/analytics/" title="Google Analytics" target="_blank">Google Analytics</a> when you change a page inside your main swf movie. That gives you the ability to do tracking on your website. Pretty neat!</p>
<p>Has some of you might know, <a href="http://www.google.com/analytics/" title="Google Analytics" target="_blank">Google Analytics</a> has released a new tracker code (from urchin.js to ga.js). What more does it do for you right now? Not much, it&#8217;s supposed to be smaller in size and that&#8217;s about it. No event yet (there was a lot of buzz around events in <a href="http://www.google.com/analytics/" title="Google Analytics" target="_blank">Google Analytics</a> and there is actually documentation on how to implement them but they are still in closed beta; we will have to wait on this one), no new functions. But if your launching a new website I would advise putting the new tracker code (ga.js) because it will save you maintenance time when you will want the new features.</p>
<p>So does <a href="http://www.asual.com/swfaddress/" title="SWFAddress" target="_blank">SWFAddress</a> works with the new code? Well the answer is yes, and it is pretty easy to make it work here is sample code showing you how to do it:</p>
<pre id="line1">&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>&gt;
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
&lt;/<span class="end-tag">script</span>&gt;
&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript"</span>&gt;
var pageTracker = _gat._getTracker("UA-xxxxxx-xx");
pageTracker._initData();
&lt;/<span class="end-tag">script</span>&gt;
&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript" </span><span class="attribute-name">src</span>=<span class="attribute-value">"js/swfobject.js"</span>&gt;&lt;/<span class="end-tag">script</span>&gt;
&lt;<span class="start-tag">script</span><span class="attribute-name"> type</span>=<span class="attribute-value">"text/javascript" </span><span class="attribute-name">src</span>=<span class="attribute-value">"js/swfaddress.js?tracker=pageTracker._trackPageview"</span>&gt;&lt;/<span class="end-tag">script</span>&gt;</pre>
<p>The most important part of the code is the last line where you tell <a href="http://www.asual.com/swfaddress/" title="SWFAddress" target="_blank">SWFAddress</a> which tracker to use. That&#8217;s it! I hope this saves you some time.</p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.zedia.net%2F2008%2Fswfaddress-and-the-new-google-analytics-gajs%2F&amp;layout=standard&amp;show-faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:550px; height:70px;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.zedia.net/2008/swfaddress-and-the-new-google-analytics-gajs/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>
