13.07.2015 Views

ebook on regular expressions for Google Analytics - LunaMetrics

ebook on regular expressions for Google Analytics - LunaMetrics

ebook on regular expressions for Google Analytics - LunaMetrics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

wH y use reg Ex?In <strong>Google</strong> <strong>Analytics</strong>, you can useRegular Expressi<strong>on</strong>s to ...create filters. Many filters require Regular Expressi<strong>on</strong>s. Ifyou d<strong>on</strong>’t know what filters are, you can start learning about them here.create <strong>on</strong>e goal that matches multiple goal pages.Perhaps your “thank you” page has many names, but to you, all leads are the samegoal. So you can use Regular Expressi<strong>on</strong>s to “roll them up.”fine-tune your funnel steps so that you can get exactly what youneed. Remember, Regular Expressi<strong>on</strong>s can be specific.What are Regular Expressi<strong>on</strong>s, anyway? Regular Expressi<strong>on</strong>s are about“power matching.” If you need to create a goal that matches multiple thank-youpages – that is power matching. If you need to write a filter that matches multipleURLs, but <strong>on</strong>ly know what a piece of each URL looks like – again, that is powermatching.But what about Advanced Segments?Can’t I skip this whole RegEx thing now that<strong>Google</strong> <strong>Analytics</strong> has Advanced Segments?A word about language.What would a how-to guide be without somedicti<strong>on</strong>ary-type advice? Here are some of thec<strong>on</strong>venti<strong>on</strong>s we may use:GA: The abbreviati<strong>on</strong> <strong>for</strong> <strong>Google</strong> <strong>Analytics</strong>RegEx: the abbreviati<strong>on</strong> <strong>for</strong> RegularExpressi<strong>on</strong>s (singular and plural)Plain text: Not Regular Expressi<strong>on</strong> TextString: any assembly of characters and/orspaces. A word could be a string, a sentencecould be a string, a URL could be a string.Target String: the string you are attemptingto match with your RegEx.Example: when I use robb?(y|i)n to matchmy name, Robbin (the <strong>on</strong>e with all thefunny characters), robb?(y|i)n is theRegex, and my name, Robbin, is a targetstring.A word about <strong>for</strong>mat.I just hate when I read a post or book andthey write that the keyword is “sodapop.”Or “vanilla.” Or anything that has quotati<strong>on</strong>marks around it. Because you never know ifthe quotati<strong>on</strong> marks are part of the stuff youare working <strong>on</strong>, or are just used to separatethat word from the rest of the sentence.C<strong>on</strong>sequently, I put all target strings andall RegEx in boldface – no quotati<strong>on</strong> marksneeded.Well, no. Advanced Segments are lovely, and they often make filtersunnecessary. But they d<strong>on</strong>’t work the same way as filters do. And youwill still need Regular Expressi<strong>on</strong>s to create interesting and complicatedgoals, and to accommodate your website designer who doesn’t do thingsthe <strong>Google</strong> <strong>Analytics</strong>-friendly way. And sometimes, you will want touse Regular Expressi<strong>on</strong>s in your Advanced Segments. 3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!