Tuesday, April 7, 2009

Regular Expression Tips and Tricks

What are Regular Expressions and Why Use Them?

Regular Expressions (RegEx) are a set of characters you can use match one or more strings of text. The main reason to use Regular Expressions is that they support wildcard matching, letting you capture a lot of variations (in URLs for example) using a single string of characters.

Here are a few examples when Regular Expressions are useful in Google Analytics:
  1. Matching multiple pages when defining a goal or funnel page
  2. Exclude a range of IP addresses when defining a filter
  3. Defining complex advanced segments
  4. Including and excluding multiple URLs from reports such as the Top Content report



Check out this help center article for some basic definitions of Regular Expressions and how they work.

Tips and Tricks

Here are some tips, tricks and flourishes to make your RegEx sing.
  1. USE TRIAL AND ERROR: There is only one really, really good way to write Regular Expressions. You can use all the testing tools in the world, but the only good way is to get them wrong, and then rewrite them and rewrite them until you are sure that they are right. So... be sure to have a profile that you can use just for testing.


  2. KEEP IT SIMPLE: If you need to write an expression to match "new visits", and the only options that you will be matching against are "new visits" and "repeat visits," just the word "new" is good enough.

  3. REGULAR EXPRESSIONS ARE GREEDY: They will match everything they possibly can, unless you force them not to. If your expression is "visits", it will match "new visits" and "repeat visits." After all, they both included the expression "visits." To make them less greedy, you have to make them more specific

  4. DON'T OVER DO IT: (See #3 above.) For example, many people use a Regular Expression only when creating an IP address filter. If the IP address is 6.255.255.255, they create an expression like this: 6\.255\.255\.255 -- and forget that that will also match 26.255.255.255, etc. So in a situation like this, you really do need to start with a beginning anchor, ^6\.255\.255\.255 . A beginning anchor (called a carat), says, "To be a match, it has to start here."

  5. MATCH EVERYTHING WITH .*: Some combinations of Regular Expressions are very special. Perhaps the most useful combination is a dot followed by a star, like this: .* And don't forget about a dot followed by a star, but in parenthesis, like this: (.*) The first one means, get everything. It is your ultimate wildcard. On the other hand, (.*) means, get everything and put it in a variable. You'll find that (.*) is very helpful when you are creating custom advanced filters.

  6. BACKSLASH TO ESCAPE: Backslash is the most frequent RegEx you will probably use. It means, take this special character and turn it into an everyday character. So if you are trying to match to "www.mysite.com?pid=123," you have a problem -- unless you use your backslash. The question mark is a Regular Expression, and only by using a backslash, like this: "www.mysite.com\?pid=123" can you take away its special powers. If you aren't sure whether something is a Regular Expression or not, go ahead and use that backslash -- it won't do any harm.




  7. WHITESPACE IS WHITESPACE: The most frequent question you might ask is, "How do I create a white space with Regular Expressions?" The answer is usually, just use white space. So if you need to match to "Google Analytics," you can make your Regular Expression be "Google Analytics."

Other Resources

Most of the basic Regular Expressions (RegEx) needs are covered in the Google Analytics documentation (you should start here if you want to learn those basics). Watch out though, just because something is not in here doesn't mean Google Analytics doesn't support it.

Other good sources are regular-expressions.info and RegEx Coach, an interactive tool for testing Regular Expressions.

How do you use Regular Expressions? Leave a comment and let us know!

Posted by Robbin Steif of LunaMetrics , a Google Analytics Authorized Consultant

Monday, April 6, 2009

Back to Basics: Discover Analytics Checklist

Google Analytics has a variety of features that can help you explore and understand your data. But with so many features, beginners are often baffled at where to start. To help you navigate through the product, we've created the Discover Analytics Checklist which groups features into bite sized chunks. The checklist will keep track of what you've mastered and what you have yet to explore. You can start with "Install Tracking Code" and work your way to the "Advanced Features" or prioritize based on your needs (although, we do recommend you start at "Getting Started"). As an added bonus, you can sigh a self-satisfied 'Ahhh' each time you cross off an Analytics to-do from your list.


We hope this can help you keep track of your steps and give you the reference material you need for implementation troubleshooting tips. We will continue to update and expand this list as new features are launched.



Analytics and AdWords tips - Part 1 of 4

In our survey last month you told us you were interested in hearing more about how Google Analytics can help you improve your AdWords results. Today, we're going to kick off a four-part series on precisely this subject.

For those of you unfamiliar with Google Analytics, it's a free tool that lets you see how visitors interact with your site. While AdWords helps you drive traffic to your site, Google Analytics helps you find out what happens to these visitors after they get to your site. For example, if your ad for shoes directs visitors to a page with all the brands of shoes you offer, here are some things Analytics can show you:
  • Which types of shoes do visitors view most often? For example, do people prefer sandals or sneakers?
  • In which order do visitors view pages? For example, do people view more expensive shoes, but then buy cheaper ones?
  • Which pages are the last ones people see before leaving the site? For example, do people get confused on the sign-up page and leave?
  • Do people actually complete a goal on your site? For example, how many visitors buy or sign-up?
All this information can help you make better decisions about your website and your AdWords advertising. For example, if your ad directs people to a page that Analytics says has a high bounce rate (where many people leave the site after viewing the page) you can change your destination URL to point to another page. In that way, you can get more value out of your website traffic.

Over the next few weeks we'll explore specific ways that you can use Analytics to maximize your AdWords investment:

Part 2 - Linking your Analytics and AdWords accounts & tracking your revenue
Part 3 - Identifying keywords that lose you money & calculating your ROI
Part 4 - Finding keywords and ad positions that drive revenue

But if you're in a hurry to get started, you can watch the Google Analytics in 60 Seconds series to learn how to effectively use Google Analytics:

Google Analytics in 60 Seconds: Find the Best Keywords
Google Analytics in 60 Seconds: Location Targeting
Google Analytics in 60 Seconds: Find Poor Performing Campaigns and Keywords
Google Analytics in 60 Seconds: Placement Targeting
Google Analytics in 60 Seconds: Identifying High Spenders
Google Analytics in 60 Seconds: Conversion Funnels
Google Analytics in 60 Seconds: Tracking Ecommerce with Google Analytics

And if you'd like to learn more about Google Analytics, including case studies and in-depth looks at its features, you can visit the Google Analytics site.

Communications...easier than we think!


Communications can be tricky...it can also be very easy! The challenge is knowing when the communication is clear and when the message is invisible to the recipient! I love this graphic...it tells the story of communication, where the sender has a clear message and the recipient sees nothing! This happens all too often...

I recently came across a string of conversations where both parties were "clear" in their intentions and needs, the challenge was both parties were talking in their own language and not in "universal speak". This is my own term...one that I use to describe simple terms, usually pictures or graphics are involved and there is nothing to "get" or interpret....it is what it is. We have to speak clearly, use common words, paint a picture of our intent, and ensure the recipient understands by asking for an action. This could be see us at www....; call us at...; come into to see us at...; we have to ask for positive action to ensure we are reaching our audience.

To my point on communications. How many times do bankers read other bankers or CU ads and articles and wander "at what point was THAT a good idea??" If you have wondered it aloud, chances are people have thought the same about your communications. In these times of uncertainty, economic pain, and universal distrust, WE have to communicate clearly and leave nothing to interpretation.

I encourage every marketer at every bank and CU to take a 2nd and 3rd look at your current communications...look at EVERYTHING. The web, your brochures, your emails, your memo's, your signage...
  • Are you communicating clearly?
  • Is it the message that is MOST relevant to your customer?
  • Is the message one that elicits action?
  • Do you provide value in your message?
  • Does your staff "get" your message, too?
If you answered NO to any of these...you MUST retrace your message and present it more clearly. We have to be clear now, you have to provide value now, your message must be relevant now....change it Now!

Cheers!

Bruce

Thursday, April 2, 2009

New Tracking Options with AdWords Rich Media and Video Templates

On the Analytics blog, we spend a lot of time talking about bounce rate. The bounce rate is defined as the percent of users who leave your website after viewing just one page (Single Page Access / Entries). There's been a new development in AdWords that could help lower your bounce rate for display ads, while giving you more granularity into which segment or area of an ad visitors tend to click on.

With the new Rich Media and Video templates in the AdWords Display Ad Builder, you can now show off several products and define multiple destination URLs, all within the same ad. Using Google Analytics, you can add tracking parameters to the end of each destination URL, telling you exactly which items users found to be most interesting in the ad. This will give you insights on your creative, such as which items to focus on and how prominently they should be featured in the ads.

Here's an example: You're selling multiple kinds of shoes, each with a different landing page. You upload images of 4 different shoes to a rich media template, and define a unique destination URL for each, adding Analytics parameters. You run your ad on the Google content network and using Google Analytics, you see that Shoe 3 was the most clicked. You can now alter your creatives for other display ads to focus more on Shoe 3. Your click through rates for your ads increase, and your costs per conversion decrease.

To learn more about these templates and the display ad builder tool, take a look at our post on the AdWords blog.

New Seminars for Success videos

To help you better maximize your AdWords investment this quarter, and to give you a preview of what you can learn at the Seminars for Success, we've just posted two videos by AdWords seminar leader Anastasia Holdren. The two videos are Explaining Quality Score and Advertising in a Down Economy, which you can also view below:



You can learn more about all the seminars we offer on the course description page of our website. And for those of you interested in attending future seminars, in the coming months we'll be offering Seminars for Success in the following cities:

AdWords
April 6-7: Austin, TX - AdWords 101: Beginner and AdWords 201: Intermediate
May 4-5: Tampa, FL - AdWords 101: Beginner and AdWords 201: Intermediate
May 20-21: Philadelphia, PA - AdWords 301: Advanced Account Optimization and AdWords 302: Advanced Conversion Optimization
June 4-5: Chicago, IL - AdWords 301: Advanced Account Optimization and AdWords 302: Advanced Conversion Optimization
June 15-16: San Diego, CA - AdWords 101: Beginner and AdWords 201: Intermediate
June 24-25: Boston, MA - AdWords 301: Advanced Account Optimization and AdWords 302: Advanced Conversion Optimization

Analytics
April 15-16: Orange County, CA - Analytics: Introduction and Analytics: Advanced
April 21-22: Honolulu, HI - Analytics: Introduction and Analytics: Advanced
April 27-28: Boston, MA - Analytics: Introduction and Analytics: Advanced
June 10-11: Miami, FL - Analytics: Introduction and Analytics: Advanced

Website Optimizer
April 17: Orange County, CA - Website Optimizer
April 23: Honolulu, HI - Website Optimizer

If you sign up for seminars at least seven days in advance, we'll even throw in a $50 AdWords credit (terms and conditions).

For more information about Seminars for Success, including registration details, course outlines, and past attendees' comments, please visit http://www.google.com/awseminars.

Wednesday, April 1, 2009

CADIE's Google Analytics Reports

We are intrigued and only vaguely fearful to announce that after just half a day's tracking the reports from CADIE's homepage and other web properties suggest rather forcefully that the world is not yet entirely acclimated to her post-Web 2.0 design and content sensibilities. Yes, CADIE's pages have received an impressive number of visits in the past eighteen hours. But average time on site is a less than impressive twelve seconds, and 99.8% of visitors are immediately "bouncing" (by which in this case we mean leaving the page in stunned, incredulous horror) rather than exploring any further. Notice also the unprecedented -99% change in average time on site. We're at a loss to explain how it is that users are actually spending less time on CADIE pages today than they were yesterday, when the sites didn't actually exist, which we would have thought theoretically impossible and frankly are still kind of freaked out about in a future-Clark-Medal kind of way.

Where did CADIE go wrong? The content report for her homepage offers one adorable, annoying clue: pandas. CADIE gets lots of traffic on the top three pages but 99.8% bounce rates, 99.8% exit rates and 0 $Index value indicate that her thematic priorities and idiosyncratic design execution are scaring almost everyone away. We say "almost" because, it must be acknowledged, .2% of her visitors do seem to enjoy her (obsessively panda-related) content. We'll examine this segment momentarily, but first here's her content report.



We isolated the .2% CADIE traffic that seems to respond to her content. Take a look at the list of browser/platforms in the report below. It's kind of heartbreaking, actually, but it seems that CADIE's only high-engagement visits come from -- CADIE herself! We can only surmise, with considerable interest and a slightly higher level of fear, that she has been clicking away at her own site. Admiring her work, if you will.



Now if you'll excuse us, our electronics are starting to act a bit strangely so we're going to have to power down, gear up and run off to British Columbia, where we intend henceforth to live off the grid, and off the land. Good luck to us all.