Google I/O 2011: Optimizing Android Apps with Google Analytics

Mui: Good afternoon, everybody I know it’s really tough after lunch, particularly for those who haven’t got lunch yet Uh, but we’re going to spend the next hour or so talking about how to optimize your Android app with Google Analytics So here, uh, we–we– the three of us are from the Google Analytics team I’m Phil, this is Nick, and that is Jim But really, Jim and Nick are the experts in the group So as a show of hand, how many of you are not Google Analytics users? Oh, great. See why I ask the opposite way– it would be a very different story So for those of you who don’t know Google Analytics, that’s a screen shot from the current version of Google Analytics It is essentially a tool that helps you as a marketer, developer, Web site owner, to understand who are coming to your Web site, what they are doing, and how you can optimize your various marketing activities So in the last month or so, we have released a slightly new version of it So it looks something like that Who has seen the new version already? Raise your hand Great In this new version, is a, uh, number internally, that we, uh, called version 5 So this is probably the most significant version upgrade that we have in the product in the past five years, since the beginning of Google Analytics So many of you think of Google Analytics primarily in the vertical of Web site analytics, so let me reemphasize and reestablish your trust in Google Analytics by showing you a few of the customers that use G.A. on a daily basis Who recognizes the first icon? [laughter] Mui: Remember, it is whitehouse.gov It is not whitehouse.com Uh, what about the second one? What is that? man: [speaking indistinctly] Mui: Wow, my goodness This is a government employee or somebody who is interested to do spy work That is indeed the FBI, along with a list of Fortune 500 companies and large companies that you may recognize These are companies that use Google Analytics exclusively Now the point I want to make here with this slide is many of you have heard about various tracking issues on the Web, but if the U.S. government, or if you prefer, if Mr. Obama trusts Google Analytics, shouldn’t you trust Google Analytics also? On the rich media side, this is probably less well-know So here’s a series of platforms that have native Google Analytics tracking built into it Many of you develop in AS3, ActionScript 3, uh, or Adobe AIR, or Microsoft Silverlight, for the few of you who still do that, uh, AJAX applications and so on If you would like to try natively your applications in this platform, there are various SDKs you can download, and do tracking with your development On the mobile side– so the reason that we are all here is because of Android, but it’s also true that we have a native SDK with the iOS platform, for those of you who develop in that area Perhaps these days, in order for anyone to be hip, you really have to talk about Social And so here is a few of the social measurement companies, plus tools that will be useful to you if you are interested in this area So twitter.com, who is right here in San Francisco, is one of the largest Google Analytics users Um, how many of you develop Facebook apps? Oh, really? Okay, this must be a Google conference So for those of you who would like to develop Facebook apps, it turns out that there is an FBML tag natively built into the, uh, Facebook platform, called Google Analytics And let me also, as a show of hands, anyone here play “FarmVille”? Or anyone here who dare to raise their hand that they play “FarmVille”? So it turns out that, you know, that’s one of the most popular social casual games on the Web Uh, FarmVille has been, uh, optimizing it’s, uh, experience, with the help of Google Analytics So that’s– that’s pretty cool Now if you, uh, of course, use any of the, like, WordPress or iGoogle, et cetera, you would also realize that for many of these platforms, there are plug-ins, particularly for Google Analytics So the point of this slide is that many people associate Google Analytics with Web analytics tracking, and this slide now, if you have never seen this before, can really tell a different story What we are trying to do here on the team is try to build a 360-degree tool for you as a developer, as a marketer, to have that complete view of your visitors

as they go through your digital online experience So Google Analytics has evolved It has evolved into an analytics platform– or, we’re still not there yet, but we are definitely working hard on it So focusing on this presentation, we are going to talk about Android, and we recently released an update to Android, and these are the two experts who will tell you more about it, but for those who–who care, there are a few core tracking capabilities that you will be able to get out of this native SDK Of course you can track unique users or page views and events, and more recently, you can also track your e-commerce transactions, if you do that on your mobile phone, um, or if you want to set custom variables or if you would like to track market referrals for the Android Marketplace So without exposing my, uh, my ignorance of some of these, I’m gonna pass to the experts, who will tell you how these things work. Nick Mihailovski: Thanks, Phil All right, guys, so today we have a bunch of demos that we’re gonna present to you on how you can leverage our Google Analytics SDK for Android Um, how–how many people here have used Google Analytics for Android? A couple people Some people. Okay So for some of you, this might be introductory, but we’re gonna take you through the whole process of best practices, how to set it up, as well as how to interpret some of the reports that you might not have used in there previously So before we get into the demos, I want to set a little stage for people who are new to the product, uh, and talk about how you get started Uh, it’s really simple The first step is we offer an SDK you can download from our site It’s a zip file which has a jar You link the jar to your library, and then you need to set two permissions– you set the internet and the access network state permissions, and once you have that–boom, you’ve done all the configuration, and you’re ready to start coding Now on the code side, we also made it really easy The library provides a Google Analytics tracker class, and on the onCreate method within your activity, you grab an instance of that class, uh, which is returned as a singleton, and you call start, and you pass it your account ID and the context An account ID is common to what Google Analytics– what you’d normally see in a JavaScript interface man: [speaking indistinctly] Mihailovski: All right Come talk to us afterwards, and–it’s fine Um, what I really want to illustrate with this is this is a very simple snippet of code, but magically, there’s a lot of stuff that happens under the hood What we do is if you’re a first-time visitor to an application, we create a random ID, and create a SQLite table and store the ID in a table Now if you return to the application, we see if the table exists, and we retrieve the ID, and we can associate that unique ID with the user Now this ID is completely random It’s not the device ID It does not tie to anything personally identifiable What it allows us to do, though, is track unique users for the content in your application So how many 7-day active users do you have using your app today around the globe? These are the questions Google Analytics can answer So before we get into the actual tracking, um, it’s also important to understand how data is sent to Google Analytics So instead of when– traditionally when you make a tracking request, data is sent directly to analytics In RSDK, it’s a little bit different We actually store all the data in a queue, and then send all the data as a batched request And this helps us save battery life, as well as allows us to track users when they’re offline So if there’s a spotty connection, we can still track them, and then finally when they resume their connection, we can send all the data to analytics And to do that, we can manually do it, calling it a dispatch method, or overload the start method, uh, with the interval, which is the number of seconds to send all the data So now what we just talked about was how to get the library and get started, we talked about how to instantiate a tracker method, and we just talked about how to send data to analytics So let’s get to tracking Now as application developers, it’s important to understand how users interact with content So in Android, this means tracking activities or views Now in the Web, we typically measure viewing of content as Web page views, and this page view essentially means that we’re tracking the number of loads or the number of times the screen has changed, so in an application, we can use the same concept and track the number of times the screen has changed as well with page view tracking Now as a best practice, we usually recommend you use page view tracking when there’s a significant amount of content that changes on your screen, and using something differently, uh, when you track interactions with the content And we’ll show you that a little bit later So with that, let’s get to the first demo and talk about how to track activities Cotugno: Thanks, Nick Uh, before I show code, I want to tell you

that we’re gonna use the notepad sample application that you can find in the Android SDK, and, uh, let me go through that application for those of you not familiar with it Uh, here I have the notepad application You can simply add notes here See if I can type Oh, I can’t type I don’t know if many of you have seen Nick at nite He’s pretty funny, I hear, so And then, uh, you can edit notes Let’s see if we can– let’s click on this And you can edit the title, so let’s put an exclamation point on the title Oops. Well, that’ll work And then you can delete, uh, you can delete a note as well And that’s the notepad application in a nutshell So what I’m gonna do now is add some tracking code to the notepad application And here, uh, is my project Uh, and you can see, uh, that we have several activities that make up the notepad application I’ll start with the notes list activity, which is the first one that, uh, comes up when you launch the application And Oops Let’s try this way And let’s go to, uh, I guess we’ll start here I’ve declared an instance of the tracker object that I want to use to do my tracking And then here, in my onCreate method, I’ve, uh, instantiated instance of the tracker, and I’ve started it up, and then here on my onResume, I’m gonna go ahead and track the page view Let’s see if I can highlight that for you I’m using the application– or the activity’s class name for this, uh, so that’s for my notes list I’ve also, since there are several other activities here, um, I’ve decided to create a subclass that they can all extend called “tracked activity,” and again, tracked activity does, uh, exactly the same thing onCreate, we start up a tracker, and then onResume, uh, we call track page view Now, uh, I would run this application, but you wouldn’t see a whole lot, ’cause all the tracking happens behind the scenes Uh, fortunately for this latest version of the SDK, which we put out last week, I added a little help in terms of debug support So what I’m gonna do– first off, I’m gonna shorten my interval to one second, so we see things happen quickly And then I’m gonna add, uh, a debug flag, turn that on What this will do is this will, um, put some debug messages in the log so that you can see when the hits are generated and what they look like And then there’s another feature we added, uh Calling it Dry Run, and when you set that to true, we won’t actually send the hits all the way to Google Analytics So you don’t have to worry about polluting your data space while you’re doing testing and debugging So let me go ahead and do the same thing to the other class Add this code in there Mihailovski: Make sure you save ’em, too Cotugno: You want me to save it? Did you say you want me to save this? Okay, it’s all saved Let’s run it and see what happens Well, actually, before I run it, let me show you a log– you’re probably all familiar with logcat on the Android ADB Uh, we’ve, uh, tagged all our Google Analytics debugging with, uh, the tag Google Analytics tracker, and you can see here, I’m gonna run the logcat, and I’m really only interested in the tracking code, and I’m gonna suppress all the other debug messages in the system, so we’re all set to go And we’ve run We go back, and as you can see,

we’ve already gotten our per– our first, uh, hit generated as a page view, uh, and you can see that the activity, uh, name–notes list is there If you recall, that’s the first view So I’m gonna go ahead– I can’t, uh, you can’t see real well what I’m gonna do, but I’m gonna go ahead and add a note now And you can see now, uh, we’ve got a page view track for the note editor, which is the activity class that you use to enter notes And then I’m gonna go ahead and edit the title I went back to the– sorry, forgot about that Uh, going back and forth, I’m gonna go ahead and edit the title, and you’ll see the title, um, come up here, the title editor Oh. I must have pressed a button there So you can see the page views tracking is happening, uh, pretty much as I navigate through the application So at this point, I want to turn it back to Nick, so he can show you the reports Mihailovski: Cool. Thanks, Jim So, uh, so my slides aren’t showing up for some reason here, but they should be So, um, when you log back in to Google Analytics, uh, in version 5, you can go into the content section, the pages report, and you can see the total number of activities, uh, and the number of page views that you’re tracking for each of these activities And so the key part, what Jim demonstrated was, was that the class name, um, by passing that to the track view–page view method, allows you to associate the classes and activities with the actual content in the reports Now remember, um, we talked a little bit about having a unique user ID, um, that’s random, associated with every time a user interacts with your content, and what we can do with the custom report in Google Analytics, is get a breakdown of the total number of unique users who have actually looked at one of your activities So to do that, we use what’s called a custom report, and in the version 5 interface, you see it in a new custom reports tab Here we click a new custom report We configure it using the page dimensions and the total visitors in page views metrics Now what we do is, once we click save, we see a new report here that shows us total visitors as well as the total number of page views Now this means during the date range of March 15th all the way through April 14th, this is the total number of unique users who have actually been to these different activities, which is kind of unique In this case, we see that they’re about the same, so between the notes list and the notes editor activities, but significantly lower in the title editor activity Now this means people have never used this part of the application during this time, and as a developer you might question, well, why aren’t people– why isn’t this number similar to these other activities? Maybe they’re not able to explore and find this activity, uh, maybe there’s some usability issues So what you’re able to do here is use the data to understand where there might be an issue, and maybe a place where you can start improving the performance of your activity, um, and using the data to help guide decisions on how to, uh, improve your applications So that’s how we track content interactions The next thing we want to show you is how you track, uh, user interactions In this case, we use what’s called event tracking in Google Analytics Uh, what we’re interested in tracking in our application is the number of times people delete and act–delete a note, and we’re also interested to understand from which activities are notes deleted the most So, Jim, let’s take a look at a demo, and see how to set that up Cotugno: Thanks, Nick Okay, so we’re gonna take our notepad application again, and I’m gonna add some events to track deleting the notes Now there’s two places you can delete a note– you can delete a note from the notes list– the very–the main view, and then you can delete also from the note editor So here, um, I have added code into, uh, the notes list I’ve highlighted that– whoops, wrong screen, sorry Let’s try that again Okay, that’s better So now I’ve added a track event into the notes list where, uh, where we process the delete, um, function, and we’ve added a category of UI interaction, the action is delete, and the label– we’re using the activity class name for the label here And, uh, value is not relevant, so I set that to 0 And here’s the note editor class, and we do exactly the same thing, uh, UI interaction is our category, delete is our action, and note editor, this time, is the class Let’s go ahead and run this

And move over to our logcat screen I’m gonna go ahead and add, uh, a few notes here real quick So I’ve added a note “R,” a note “Q,” and I’m gonna add a note “S.” Guess I got the alphabet a little wrong there I’m gonna go ahead and delete my first note from, um, the main screen I’ve deleted it, and there you can see the event track come through See if I can highlight the relevant stuff There’s the event category Uh, there’s UI interaction, a delete, and the notes list So let’s go ahead and edit the next note on our list And I’m gonna go ahead and delete that And there’s our second, uh, event Let me And you can see that this one indicates that we used the note editor to delete it And I have a third one here, so let’s go ahead and delete that from the main screen And again, you can see the event come through and track That’s really all there is to it, and Nick will show you the reports again [clears throat] Mihailovski: Thanks, Jim So once we’ve collected the data, we can now log again back into the UI, and start seeing what’s going on In this case, we look at the content section, now we go to the event section and the top events report, and here we see all the events that we’re starting to track And when we click this button, boom, we get the number of times a note was deleted overall And, boom, we can click on that, and because we’re sending the class name, which associates with activity, we can now differentiate by activity where people are deleting this note the most Now we won’t stop there What we really want to do is not only look at the total number of times stuff was deleted, but we also want to understand the total number of unique visitors, or unique users, who have actually used this feature of the application And to do that, we can create a custom report In this case, we use the event action dimension, and event label dimensions, and we also here are looking at total visitors and total events Now when we click save, the report shows us for every time people deleted a note, the breakout between the notes list and the notes editor, as well as the total number of unique visitors in the date range who have actually used this feature Now in this example, we see that the total number of times people deleted a note from the notes list section was about four times greater than the total number of people who deleted a note from the notes editor activity Now as an application developer, I’m really curious in why are– is nobody using this feature that I spent all this time developing in my app? Maybe people don’t know about the feature, maybe the feature’s hard to use It’s again, using this data that you collect from Google Analytics to help understand where people are not really leveraging your application to your full potential It also might make sense, you know, if you’re trying to understand where to invest time and resources, you might either promote this or try to get rid of the feature at all because people aren’t using it So again, here’s a great way on how you can use data to start optimizing your applications So we just talked about tracking views, we talked about tracking content interactions The third thing we’re gonna talk about is tracking user preferences In this case, what we want to understand is how behaviors differ by orientation of the device Are certain features used more when it’s in portrait mode or landscape mode? And what this example will show you is how to start using Custom Variables to track user preferences Now before we get into the demo, uh, how many people here know what Custom Variables are? Okay, so we’re gonna– we’re gonna take a step back and do a little conceptual overview of how they apply So if you think of an application, you have a user who comes to your application and interacts with content He might return sometime, view more pages He might even come back and do a transaction In Google Analytics, we call each of these visitor, session, and page levels Now a custom variable allows you to describe each of these levels, so for example, you might describe a visitor who’s made a purchase, and compare them to visitors who haven’t made a purchase You might use a session Custom Variable to compare users who have logged in versus who haven’t logged in And you might use a page custom variable to compare users who have gone to a particular page that belongs in a category– for example, news versus sports Now in the Google Analytics, uh, SDK for Android, we make this really easy, providing by–

providing the set custom bar method Now this method accepts four parameters At any given time you can send up to five Custom Variables to analytics, so the first parameter is which custom variable you want to set, the second one’s the name, the third is the value, and finally, the fourth corresponds to the level In this case, one is visitor, two is session, and three is page So now that you all know how Custom Variables work, Jim, let’s see the demo of how to track the orientation Cotugno: Okay, thanks, Nick Again we’re taking our notepad sample application, and we’re adding, um, some Custom Variable support here So here I’m showing you the code in our tracked activity class, and, uh, you can see at the beginning, we’re setting up our tracker, uh, like before, uh, and then we’re determining the orientation of the device, and then finally you can see we’re set– doing our setCustomVar call We’re using slot 1 Uh, the name for this custom variable is screen orientation, and the value is going to be the orientation that we determined above, and we’re gonna give it a session scope, uh, which is 2 I’ve done the same for our notes list, um, activity as well So let’s go ahead and run this You want to take this? Mihailovski: Oh, yeah, sure Cotugno: Yeah, you want to have Mihailovski: Okay, is it running? Cotugno: Not yet It will be in a second Okay, I’ve– I’ve fired it off, and you can see we’ve already got our first page view Mihailovski: So if I turn it here, if I turn it back– uh, if I– we add a note here and turn to editor And enter Cool So now we’re tracking all the orientation by, uh Yeah, cool Cotugno: You having fun with that? Mihailovski: Yeah, it’s pretty cool Cotugno: Okay, uh, that’s really all there is for Custom Variables Why don’t you show us what the reports look like? Mihailovski: So where does Custom Variables show up in all these requests? Oh, we lost it Cotugno: It’s back Mihailovski: Okay. Cool So now that we’ve collected all this data as Custom Variables, what’s really powerful about Custom Variables, uh, is that we can create what’s called an Advanced Segment and use–and segment the number of users who have used one preference versus the other across all of our reports So I’m gonna explain what that means In Google Analytics, we have what’s called Advanced Segments, and in the new interface, you can see it under the Advanced Segment tag When you click this button, a little dialog pops up, and you can see a bunch of default segments, as well as you have the ability to create a new Advanced Segment So in this case, we’ll create a new one, and in the dialog, what we say is, we set the custom variable 1, um, the value 1, to exactly match every time we’re setting portrait Now what Jim was collecting and sending to analytics was the portrait string when people were in portrait mode, and landscape when people were in landscape mode So here we create a Custom Variable to match all users who have actually been in portrait mode We can similarly come back into Analytics and create one that’s everybody who was in landscape mode When we click slave, we end up having two custom segments So again, what’s great about this is now these two segments of users, we can apply this to any of the reports in Analytics and compare the behavior between each of the groups So let’s go back to this, uh, report that we looked at earlier And in this case, we saw that the notes list, the total number of visitors who viewed the notes list and the notes editor activities was effectively the same But now when we apply these two new Advanced Segments, we see a slightly different story On the notes list side, we see that people significantly, uh, used the portrait orientation more than the landscape orientation now that would make sense, because in a list, there’s– you can have a lot more items in a list when it’s in portrait mode, versus in landscape mode, when you have a lot fewer items On the notes editor side, we see something slightly different We see the usage is about the same, and if you think of the flow of the app, we see that when you’re in portrait mode and you long press to get into the edit, the default orientation is– is still portrait You actually have to then go to landscape to get the editor view But when we see the total number of engagement or page views, it’s significantly higher for those visitors in landscape mode, and that’s probably because users are preferring to use landscape mode while they’re editing, because the buttons are a little bit wider So here’s a great way on how you can capture data from users and their preferences, apply ’em back into your reports to see how they’re using your application

based on different preferences they have in–that they’ve set Cool So the last demo that we want to show you, um, is–is a new feature that we just launched last week, which is E-commerce Tracking in our SDK So increasingly, uh, applications are enabling people to buy virtual goods, and to conduct e-commerce transactions directly in the app, so with this new update, we allow you to track transactions and items directly in Google Analytics So before we go into the demo, I kind of want to talk a little bit about, uh, the different components and how they all work together So if you think of a shopping basket, you have one transaction and a bunch of items In Google Analytics, each of these are different objects, so you have one transaction object, and a bunch of different item objects that you can create, which are data, and they’re all tied together using an order ID So once you have those objects, you add ’em to the tracker, calling the addTransaction and additem methods, and what this happens is– it effectively fills your shopping basket in an e-commerce bucket– buffer And once the buffer–once you have all your items defined, you call track transactions, and this sends it to the dispatcher, which then queues it up to send it to Google Analytics So now that we see how all the pieces work together, Jim, let’s see how it works Cotugno: Okay, thanks So we have, um, if you’ve looked at the samples for in-app billing, um, there’s the one called “Dungeon,” and I’ve taken that and I’ve made some modifications, uh, to make it a little bit more interesting and to add some tracking for e-commerce So here’s the key method This is a callback on purchase date change, and this gets called when the transaction that you’ve requested has been, um, confirmed by the system, and what I’ve done then is added code to, uh, log the transaction in Google Analytics, uh, at this point in time So if you look at the highlighted code near the bottom, uh, you can see that, uh, if the purchase has–has gone through, the purchase state is–is “purchased.” We’re gonna add a transaction to the tracker, and, uh, we pass in an order ID, which is passed in to us in this callback method, and then, uh, for price, uh, all items in this demo application are 99 cents, and so we just put a 99 cent price in there And then we add an item, uh, we use the order ID that’s passed in so we can tie the transaction back to the item, and then we add in the item ID, uh, which is passed in as part of this callback And again, every item is 99 cents, and for this application, uh, every transaction is one item purchased Uh, so let’s go ahead and run this Make sure– I want to make sure that our log–logging is on It is Let’s go ahead and run this And what I’m gonna do is I’m gonna flip over to the device so you can see, uh, this application a little bit So, uh, here’s the application It’s got one light item, so you can select, uh, a blue sword or a red sword or a potion for purchase And when you do that, uh, let’s try it You’ll get this confirmation screen We’ll go ahead and purchase, and the purchase has come through So let’s flip over to our logcat screen, and as you can see, we have two hits have been generated One–the first one– Let me highlight it here– is the transaction hit You can see the order ID It starts it at 1-3, and 1 line and comes across, and then you have our item hit coming next You can see, uh, it’s got the same order ID Should be able to see that there, and the blue sword is what was purchased So I’m gonna go ahead and purchase a few potions here, ’cause I need lots of help Mihailovski: Keep dying in the game? Cotugno: Oh, wait I purchased another blue sword Mihailovski: Hmm, you like the blue swords, huh? Cotugno: Yeah, I got two of those now All right, so let’s try– let’s try a potion now And there it is You should be able to see the potion And I need lots of healing potion, so let me buy a few more here There it is

And there it is And that, uh, that’s all there is to it really So, Nick, why don’t you show us what the reports would look like Mihailovski: Cool So once you’ve collected the data, in the new version 5 interface, you simply go to the conversion section, uh, the e-commerce and product performance, and then at the bottom we’ll show you the total quantity, unique purchases, revenue associated with each of the products So again in this case, you know, the blue sword was bought multiple times, uh, compared to the red sword If that’s the case with products, you might consider– you know, there’s a preference to blue, maybe we need more blue to– blue items in the store Um, having the data there allows you to start making these questions and starting to test some ideas So with that, um, that’s the end of our presentation Um, it’s–like, the presentation went really short, because it’s that easy for us to–for people to do, so we highly recommend you, um, go to our documentation, download the SDK, and then all the code that we showed today is available at Analytics API samples Um, if you liked the presentation, tweet it using the hash tag Android, and if you have any feedback, let us know Let us know if we did good or bad, uh, and we’ll–we’ll open it up to Q&A Cotugno: Thank you [cheers and applause] Mihailovski: Yeah? woman: Um, in the new SDK, we’re working with fragments a lot Do you have any best practices for working with fragments instead of the activities? Cotugno: Uh, not at the top of my head, no woman: Okay Cotugno: So sorry woman: No problem man: Hi, uh, I have a client server application, and I also use Google Analytics on the server side Mihailovski: Mm-hmm man: Do you have any advice on how I can correlate activity between user’s activities on the client and on the server Mihailovski: Yeah, that’s a great question So, um, right now there’s no good solution for that, the key being that you need a primary key between both environments Um, right now there’s no way to override a visitor ID, which would be the primary key Um, so not at this time man: Okay, thanks man: Hey, um, is there a way to log all of the Google Analytics data, and then send it later at, like, a user connects to Wi-Fi, in one big batch request or something? Cotugno: Yeah, uh, there’s two modes of dispatch What happens is when you actually log the hit in your code, it gets– it gets stored locally, and then it will get dispatched either through the automatic dispatch mechanism, which is periodic, or you can do it manually yourself Um, so if you wanted to wait until you got a Wi-Fi connection, for example, you would, uh, write a receiver that would say– that would call dispatch whenever a Wi-Fi connection was available That would be the way to do that man: Okay, thanks Mihailovski: Cool. Yeah man: Uh, is there now, or are there plans to have functionality for doing this sort of tracking with the NDK? Cotugno: I’m sorry? man: With the native developing kit? The NDK Cotugno: Development– oh, for Android? man: Yeah Cotugno: I don’t think we have any plans right now man: Okay Cotugno: we can talk about man: All right, thanks man: Um, any plans to open source the client code? Mihailovski: Yeah, that’s a good question So currently we don’t have an open protocol for collecting stuff We do have a bunch of the client libraries, like Phil mentioned Um, it’s something that we’d like to do, but there’s a lot of stuff to get to there man: Because– Mihailovski: So currently–yeah man: The main reason why my app crashes right now is because I think it uses the scroll lighting in the Mihailovski: Mm-hmm, as the table– as the persistence, yeah man: Yeah, and also, when it goes off, it– there’s a lot of memory exception or something like that, because it– I send lots of events Mihailovski: Mm-hmm man: Um, and I had to wrap all this code around the– the analytics to–to make it synchronous, because, uh, since it uses a scroll light, every time I insert something, there is sometimes on the SD card, or the phone is slow, the internal memory is slow, then it takes, like, 200 milliseconds to insert Cotugno: Oh, yeah man: So, um, I can’t really trigger events on, uh, onCreate and all this stuff, otherwise it will slow down a lot Cotugno: Okay Mihailovski: So currently, yeah, it’s not open source The code wasn’t really designed to be modular in open source, but maybe–maybe we could chat afterwards to– Cotugno: Yeah, I’m gonna go upstairs to the Android, uh, office hours man: Cool Cotugno: So if you want to talk more there, that’d be great man: Hi there, question’s around white space– so I want to track user comments,

but the white space really killed me for a couple hours Um, I guess really, you guys log it as a warning, but maybe it should be an exception, or– and my second question is, do you expect all white space to give me headaches, uh, or just the space– ’cause we’re really putting it into page view, and page view should not have any spaces Mihailovski: Yeah, so the page view is supposed– man: Thanks Mihailovski: Yeah, it’s a great piece of feedback Um, if you use event tracking, it supports white space Page views don’t Yep? man: Hi, we do our own tracking right now, and, um, will often alter our server response based on user, um, behavior Is there any opportunity to query for, um, query your system for information about a user? I mean, our information Mihailovski: Sorry, explain it? man: Yeah, so we’ll have a user, if a user’s ever bought something, we’ll actually send different messages to them than a user that hasn’t Mihailovski: Mm-hmm man: So on our server side, we need to know whether, you know, a user falls in a certain category Can we query from our server, query Google Analytics for information that’s stored on our behalf? Cotugno: You can’t get personally identifiable information out of the SDK at all, so Mihailovski: Yeah, so from– maybe it’s something different So what we’re talking about here is collecting data, so if there’s some data in your system that you want to send into G.A., uh, and associate with all the user behavior, you can do it through the collection side If you wanted to query for data that’s already been processed and then pull it back into your own system to close the loop, we have an export API, which you can then use So in that case, you usually have some sort of common ID, like a transaction ID, or a custom variable you can pass an ID in, and then you can query our export API against that ID and get all the usage data, and then put that into your system, and then further act on it man: Okay, thanks Mihailovski: Yeah man: Yeah, um, you mentioned that, uh, the user ID is stored in SQLite– uh, that’s, uh, in the application’s context, so if somebody does a clear data, it’s gonna wipe that out and generate a new one the next time they log in? Cotugno: That’s correct man: Okay Cotugno: And every time the app is– if you uninstall the app, it’ll also get wiped out So it will retain it, though, if you upgrade the app without uninstalling man: Right, and then we, uh, run our applications across multiple different kinds of devices– Android, RIM, et cetera Is there any way that we would be able to track, uh, the same kinds of events in the other, uh, platforms that we are working with? Mihailovski: That’s a good question So we have support for Android natively, and iOS Um, we just released the debug, Dry Run and e-commerce in Android, so we’re working on that, to get that in iOS as well Um, for the other devices, we don’t have any native application tracking What we have is mobile snippet, uh, server side stuff, so if you have mobile, like, kind of Web site, Web experiences, you can track in those devices, even though they don’t generally store– you know, they don’t have a great persistence mechanism man: No, these are entirely apps, so Mihailovski: Yeah, okay So currently– currently, we don’t have it Yeah? man: My question is on, you know, so a lot–each view you [speaking indistinctly] you know, is there any way–are you guys using any HTTP pipelining so that same connection can be used on all the data? You know, all–every time you send data, you’re making a new connections for the servers? Mihailovski: Yeah, so what– what we– the way that we implemented here is we used HTTP 1.1, so we actually do pipelining over that, so the reason why we’re batching this stuff is so we can pipeline it, and the reason was because when we first built it, we didn’t do it, and then all the battery went away man: Okay Mihailovski: So then we put it together, and now it doesn’t take up all the battery So that’s a great question man: Another question is, is there a way I can, uh, make it– you know, when I know the last activity out of my, you know, application is exited at the time, can I push all the data to the server, you know, stack them at the last time? Mihailovski: Sure man: I don’t want any data transaction in between my application Cotugno: Right, and that’s the manual dispatch I talked about before You could actually call– the method’s called dispatch in the tracker, and if you start the tracker and you pass it, uh, minus 1, I think, it will not do any automatic dispatching It will wait for you to tell it to dispatch man: Okay, so I can call it at the– the time user exits Cotugno: Right There’s one caveat there It will only dispatch up to 30, uh, hits at a time, uh, so you might loop through and call it several times, or if you keep track of how many hits you’ve generated, you’ll know if you have to, uh, call it more than once to make sure it goes through man: Okay, thank you Cotugno: Sure

man: Um, when doing the automatic updates, do you synchronize with the set in exact timer type things so that you’ll piggyback on when, uh, Google push and the other things are waking the device up, or is there a value you can pass in for aligning with that? Cotugno: No, right now we just dispatch, uh, as frequently as the time interval that you requested, so if you request ten seconds, we’re gonna dispatch more or less every ten seconds, maybe a little longer man: Okay man: On one of your initial slides, I think you had a bullet about market referrals being something that’s integrated into Google Analytics Mihailovski: Yeah man: Is there a way to get information about how your app is, uh, you know, the detail page within Market, and then the downloaders– Mihailovski: Fantastic feature We did not demo it today, so, um, so for the people who are staying late, we’ll tell you a new feature that’s– it’s been in there for a while So what happens is, let’s say you have an ad that you’re trying to get people to download your application through the Android Market Um, you can add to the link that points to the Android Market, our referral parameters With the Android Market, once somebody downloads the app, um, it’ll broadcast an intent with all the parameters, which there’s a couple– there’s one more configuration we didn’t talk about, but it’s all under Docs– it’ll read that, and then associate that campaign with the download as well So you can definitely use that, and it’s– it’s actually really helpful man: So a follow-up question on that, is there any way to get if a user as coming through a search in Market, as opposed to an advertising-based intent? Mihailovski: Currently– man: Um, is there a way to get search parameters? Mihailovski: Currently, no You specifically have to tag them man: Um, there–Google Analytics has lots of various, uh, pieces of data, like average time on page, um, things like that– uh, are those useful at all in this context? They seem random for my app And is there any plan to add the ability to say when someone left an activity? Mihailovski: Uh, yeah, that’s a good question So the averages might be a little bit misleading, because it’s kind of a calculated metric Uh, total time is probably a better metric to look at, and I think it’s available through the custom reporting, but just not the standard– standard reports So we’ll take a look at that So in many of the cases, the averages, um, might be a little bit off, but the totals should add up, right, the total time would be how many people, you know, that will always add up man: Okay, thanks Mihailovski: Sure. Cool All right, cool If you have more questions, come to office hours Cotugno: Thanks a lot, guys [applause]