Migrating to Google Analytics Async Tracking Code

Array

Recently Google Analytics moved the asynchronous JavaScript version of their tracking code out of beta; it is now the standard version of the code you will see when you visit your settings in Google Analytics. This is great, as it enhances the speed at which the analytics tracking code is loaded. If you haven’t done any customization to your tracking code, and you don’t have any “advanced” tagging on your site, migrating is as simple as getting the new version of the code from your profile settings page in Google Analytics (see screenshot), placing it in the <head> of your site, and removing your existing code. If you do have customizations, or you are tracking downloads, AJAX or Flash, off-site links, using Event Tracking or Custom Variables, then migration requires some additional work. This post is intended to direct you to right resources for these additional needs.

Customized Tracking Code

Customizations to tracking code can be as simple as modifying your code to track visitors across domains, or as complicated as setting custom variables or sending event tracking requests within the “tag”. Here is a text file displaying the migration of Google Analytics tracking code from the old version to the async version, using the code from this site as the example. In a nutshell, any function that previously was called with the “pageTracker.” prefix, is now wrapped in _gaqPush[] . The code on this site has been modified to trigger an event for every post viewed, to track who the author was. Read this post on tracking authors in WordPress with Google Analytics if you need clarification on the intended functionality. In the example script, you can see that I had to take the code that identifies and records the author, and modify it to use _gaqPush['_trackEvent'] instead of pageTracker._trackEvent(). You’ll also notice that the rest of the code is updated to the new async standards.

Downloads & Off-Site Links

Downloads and off-site links are typically tracked by using an onclick event to call pageTracker._trackPageview. Here is an example of how this has now changed.  The following HTML/JavaScript:

<a target=”_blank” href=”http://www.linkedin.com/in/adamware” onClick=”pageTracker._trackPageview(‘http://www.linkedin.com/in/adamware’);”>connect with me on LinkedIn</a>

Would need to be modified to:

<a target=”_blank” href=”http://www.linkedin.com/in/adamware” onClick=”_gaq.push(['_trackPageview', 'http://www.linkedin.com/in/adamware’]);”>connect with me on LinkedIn</a>

Notice again the the pageTracker code is ditched, and the attributes are now tucked into the gaqPush function with trackPageview.

Flash & AJAX

For requests made in Flash and AJAX, the change is essentially the same. Wrap any function calls (_trackPageview, _trackEvent, _setCustomVar) in the gaqPush function.

Events & Custom Variables

This is probably starting to sound like a broken record: take the existing function call and wrap it in the new gaqPush[] function. Here is an example of code that would be used to designate a visitor as registered using custom variables. It would have been:

trackPageview._setCustomVar(2, ‘RegisteredUser’, ’True’, 1);

but is now:

_gaq.push([‘_setCustomVar’, 2, ‘RegisteredUser’, ’True’, 1]);

Pretty basic modifications here.The important thing is just remembering where all the locations on your site are where you are using custom modifications. Most of our clients are at least using download tracking and off-site link tracking in some way, and many are using events and custom variables. The migration process won’t be immediate for some of them, but hopefully everyone will be using the async code within a couple months. I’d love to hear thoughts on any ways to make this process easier, and certainly on any details I may have left out.  Here is Google Analytics’ official Google Code page on migration.

Share where:
  • StumbleUpon
  • Digg
  • del.icio.us
  • Diigo
  • Technorati
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Sphinn

Tags: , , ,

HotGloo Versus OmniGraffle for Wireframing

I tooled around with online wireframing/diagramming apps about 18 months ago, and kind of put the whole subject to bed. If you’re used to OmniGraffle, Balsamiq, or Visio, using an online app is a bit rough. I had played around with LucidChart the most, and made the simple conclusion: a Flash powered online app will not compare to an installed application (at least in the near future). If you read my blog, you know I’m all about web apps, but I felt like this is a use case where they still just aren’t an option.

Array

But recently, I was urged to give HotGloo a shot by my partner at SwellPath, @johnpkoenig – somewhat reluctantly, I agreed. I wanted to give the whole web app thing another shot, and I like the collaboration opportunities that a web app provides, and a tool like OmniGraffle doesn’t provide. I had to put together wireframes for a project we’re working on; about 5 templates total. John had already been using it for the project, so it made sense for me to give it a go.

It really is incredibly impressive. It is one of the most impressive Flash/Flex applications I have ever used from a functionality standpoint. HotGloo just came out of Beta, and it is obvious they mean business – from a pricing and functionality standpoint. After spending a day working intimately with it, I would definitely recommend giving it a shot, and it definitely warranted a review.

I’m going to break this review down into key elements of using this type of application:

  1. Time to Learn
    How long did it take me to get up to speed and feel comfortable using the app? Pretty quick. Some initial grunts and complaints, but I got it all down within less than an hour. This includes figuring out how to handle administrative tasks (adding users, setting roles, etc.) and how to actually wireframe.
  2. Speed
    If you use Salesforce.com, you know how you have to sometimes “stop” and wait for a popup to complete a desired action; that happens a bit with HotGloo. It is one of those web apps where you learn when to wait – mostly I’m referring to when you upload an image. But once you learn when to have patience, you get a bit more efficient. I was able to complete the bulk of my work in one day. I would say it took me about 20-25% more time to do it in HotGloo, and that includes the time spent “learning” the app.
  3. Collaboration Aspects
    Ok, this is where web apps like this can crush it. HotGloo does, simply by letting you add users to a project, who can login and review or edit your templates, and in a more complicated way by allowing users to chat while viewing templates. You don’t pay for users (see more below) so you can add any number of folks to a project. It would be cool to see some other hooks built in (Basecamp tie-in, maybe Gtalk or other chat hooks, etc.). But it looks like there are some new collaboration features coming in May, so it’ll be interesting to see what those are.
  4. Overall Impression & Pricing Considerations
    Come on, it is a web app that lets you wireframe as-good-or-better than you could with an installed app a few years ago, that is awesome! That being said, it is still kind of constrained by Flash, browsers and bandwidth, and as a result, it isn’t quite as fast as using installed apps. But there is loads of promise for HotGloo, and I will probably continue to use it for certain projects. You can view the HotGloo roadmap here and see what features and enhancements are coming. Pricing is fair, you pay for projects (2 for $14/month to start, $5/month for each additional, $2/month for an archived project), and their are constraints on bandwidth, but they are large enough that I don’t see those being hit. I like that you don’t pay for users; you can add as many people as needed.

I personally would be interested in how an Adobe Air install would work in conjunction with a setup like HotGloo. But Air apps are resource hogs, and I don’t see this on HotGloo’s roadmap, so it isn’t something we’re likely to see. Anyway, give HotGloo a shot and see what you think, you might just find that OmniGraffle and other installs are now a thing of the past for you.

Share where:
  • StumbleUpon
  • Digg
  • del.icio.us
  • Diigo
  • Technorati
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Sphinn

Tags: , ,

Tracking Authors in WordPress with Google Analytics Event Tracking

Here is a script for tracking authors in WordPress using Google Analytics Event Tracking. I threw this together in response to a blog post by Douglas Karr on tracking authors in WordPress. Doug presents a way to do this using spoofed pageviews and a separate profile. I could see a use case for that method also.

If you aren’t familiar with Doug’s blog, I highly recommend it. A great resource for digital marketers, with frequent posts on SEO, analytics, social media and a variety of other subjects.

Share where:
  • StumbleUpon
  • Digg
  • del.icio.us
  • Diigo
  • Technorati
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Sphinn

Tags: ,

How to Create a Custom Advanced Segment in Google Analytics

I put this together for a SwellPath client the other day, so I thought I would share it here, since it is a bit too 101 for the SwellPath blog.

Overview of Advanced Segments in GA

Array

By default Google provides several advanced segments that you can use out-of-the-box. If you look into the upper right corner when you are viewing reports, you’ll see the Advanced Segments link and dropdown option. If you open it, you’ll see the option to check a variety of segments in the Default Segments section, ranging form Paid Search Traffic, to visits from iPhones. You can check up to 3 at a time, to evaluate next to the All Visits segment. If you want to compare 2 or more segments, All Visits can’t be unchecked. If you just want to view a single segment in isolation, you can uncheck the All Visits option. Play around with these a bit, and navigate the reporting with various segments checked. It will give you an idea of how this works, and some insight into how the data can be much different for certain segments.

Creating a Custom Segment

Once you’ve had some time to get accustomed to using advanced segments, you should walk through creating one. An easy “beginner” segment is one created to view only visitor in a specific geographic area. Let’s say North America. Here are the steps to create it.

1. Click the Advanced Segments dropdown, and look for the link on the left side that says “Create a new advanced segment”.

Array

2. The creation interface is drag-n-drop. You have the ability to choose between dimensions and metrics for segmentation. For this segment, you’ll go into Dimensions > Visitor and choose Sub-Continent Region, and drag it over to the creation interface. Choose “Matches exactly” for the condition, and then chose Northern America for the value.

3. Name your segment something appropriate like “North American Visitors” and click the Create Segment button. You should be taken back into the reporting.

4. Dropdown the Advanced Segments, check your new segment, it will be in the Custom Segments section. Then peruse your reporting and look at them metrics of your North American visitors compared to your visitors as a whole.

Viewing Custom Advanced Segment Data

Now viewing these segments might not be that meaningful to you; you might want to go create a segment for your European visitors and compare that to your North American visitors. But just follow these steps. As far as I know there isn’t a limit to the number of custom segments you can have, at least I haven’t hit that limit. Custom segments are now organized at the profile and user level, so you will only see your own segments in your account, and those segments will be profile specific. You can hide certain segments from profiles. You can share segments with other users by sending them a link; it is accessible from the custom segment management interface.

Share where:
  • StumbleUpon
  • Digg
  • del.icio.us
  • Diigo
  • Technorati
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Sphinn

Tags: , , ,

Web Analytics Wednesday at eROI

Just a quick post to promote the first Web Analtyics Wednesday of 2010 in Portland. It’s this upcoming Wednesday, January 27th, at eROI.  I’ll be giving a short presentation on real-time web analytics reporting; an overview tools available for tracking and reporting, some simple use examples, and considerations for those looking to implement real-time tracking and analyze the data. Please come by if you’re in Portland. Oh, did I mention the free beer and food (pizza probably)? Hope to see you there.

Share where:
  • StumbleUpon
  • Digg
  • del.icio.us
  • Diigo
  • Technorati
  • Google Bookmarks
  • email
  • LinkedIn
  • Reddit
  • Sphinn

Tags: ,

wheresitworking? contains reviews, insights, reflections, and ideas about digital marketing, interactive media, web applications, and ecommerce. Written by Adam Ware, a journeyman web junkie in Portland, Oregon.
Sponsored by

Search

wheresitworking Tweets:

    Want more wheresitworking?