Table of Contents
Title Page
Copyright Page
About the Author
Who Should Read This Book?
Book Companion Websites
Contacting the Author
I - Advanced Web Analytics Installation
Chapter 1 - Getting Started
Competing on Analytics
Preinstallation Steps
Basic Installation
Data Collection Grouping
Adding and Managing Projects
Tracking Script Customization
Chapter 2 - Content and Advanced Conversion Tracking
Document Names
Document Groups
Track Downloads
Tracking Exit Links
Tracking Registered Members
Tracking Conversion Actions
Track Revenue
Creating Scenarios for Funnel Analysis
Chapter 3 - Enterprise Campaign Tracking
Types of Campaigns
Paid Search Setup
Creating and Managing Campaign Categories
Identifying Campaigns
Setting Up New Campaigns
Setting Up a Fallback Campaign
Example Paid Search Deployment
Internal Campaigns
Chapter 4 - Merchandising Tracking and Reporting
Merchandising Basics
Setting Up Merchandising Tracking
Tracking Products Viewed
Tracking Products Added to the Cart
Track Pending Sales and Reconciling Orders
Tracking Products Purchased
Tracking Discount, Tax, and Shipping
Setting Up Merchandising Categories
Merchandising Setup Tips
Chapter 5 - Advanced Instrumentation
Tracking Custom Fields
Tracking Internal Searches
Instrumentation for Flash-Based Objects
Instrumentation for Ajax-Based Objects
Setting Up External Data Sources
Validating Your Code
II - Utilizing an Enterprise Web Analytics Platform
Chapter 6 - Working with Report Results
What to Expect from a Report
A Traditional Reporting Interface
Using Calendars for Time Period Reporting
Using Cross-Reference Filters
Using Drill-downs and Drill-throughs
Sorting Report Results
Color-Coding Data
Applying Report Notes and Reasoning
Exporting Data
Chapter 7 - Customizing Report Results
Using Metric Alerts
Event Management
Using Scheduled Reports
Building Custom Reports
Bookmarking Reports
Using Segments in Reporting
User Rights and Role Administration
Chapter 8 - Using Basic Reports as Templates for Customization
Visit Reports
Demographics Reports
Content Reports
Navigation Reports
Search Engines and Referrers Reports
Conversion Reports
System Reports
Chapter 9 - Using Dashboards
Defining a Dashboard
Adding a New Dashboard
Adding New Dashboard Items
Understanding Dashboard Items
Chapter 10 - Distinctive Reports and Usage
Understanding Path Analysis
Using Scenarios for Funnel Analysis
Merchandising Reports
Using Campaign Reports
Using Internal Search Reports
III - Actionable Insights
Chapter 11 - Paid Search Analysis and Optimization
Defining Paid Search Objectives
Getting Started with Paid Search Analysis
Detailed Paid Search Reporting
Optimizing Paid Search for an E-commerce Site
Optimizing Paid Search for a Content Site
Balancing Paid Search with Organic Search
Chapter 12 - Form Analysis and Optimization
Form Analysis and Form Actions
Form Abandonment
Form Page Optimization
Form Submit Optimization
Chapter 13 - Content Optimization and Competitive Analysis
Using the Long Tail for Keyword Optimization
Using the Long Tail for Content Optimization
Determining the Width of Your Internal Search Query Box
Optimizing Content for Search- and Navigation-Dominant Visitors
Using Competitive Intelligence
A - Appendix: Yahoo! Web Analytics Web Services API

Advance Praise for Yahoo! Web Analytics
In Yahoo! Web Analytics Dennis Mortensen manages to do the impossible by adding real value to our knowledge of web analytics in an already crowded market. His clear language and excellent examples make this book required reading for any web analytics practitioner interested in extending his use of freely-available tools. Dennis is one of the best and brightest in the web analytics industry, and Yahoo! Web Analytics reinforces that with every page.
—ERIC T. PETERSON, author of Web Analytics Demystified
Dennis doesn’t just know what he’s talking about, he’s built it, grown it, consulted on it, and sold it to Yahoo! Now—finally—he’s written the book. Don’t let Dennis’s smile and positive attitude fool you— he has the proverbial steel-trap mind and doesn’t miss a thing. You get the advantage of his insight, his wisdom, and his unerring ability to tell it like it is. He can explain the “why” of web analytics very well but is stellar at showing you the “how.” Specific variable settings, actual conversion tracking, and getting the most out of your search marketing dollar—it’s all here. If you want to actually derive value from these tools rather than just look at the pretty reports, Dennis lays it all out. This is a book you can count on.
—JIM STERNE, Founder, eMetrics Marketing Optimization Summit
Web analytics is complex, but Dennis prefers things to be simple. As the individual who drove the initial development of Yahoo!’s Web Analytics tool, he managed to conquer mind-numbingly complex issues by presenting them in a simple and useful way. It’s no wonder that he did it again with his Yahoo! Web Analytics book. Dennis takes you behind the scenes of this robust web analytics application and explains how to implement it in just about every situation so that you get what you need out of this tool. Whether you use the Yahoo! Web Analytics or not, this book belongs on any serious web analytics professional’s desk.
—BRYAN EISENBERG, New York Times bestselling author of Call to Action and Always Be Testing, cofounder of FutureNow, Inc.
As insightful as it is inspiring, this is the definitive book for making the most out of Yahoo! Web Analytics. It is a guiding light for navigating the solution’s capabilities and detailed enough to be a step-by-step guide. And who better than Dennis to write it! It is clear that Dennis has poured his experience from uncountable numbers of client conversations into this work. It is worth the equivalent of 100 hours of consulting from the well-known figurehead behind Yahoo! Web Analytics.
—AKIN ARIKAN, Multichannel Marketing author and Internet marketing product strategist at Unica Corporation
In Yahoo! Web Analytics, Mortensen does more than just give insight, tips, and tricks about the tool—he provides the details about the impact Yahoo! Web Analytics can have on your business with a laser-like focus on moving from data to true business insight and action. It’s a must-read for those interested in not only web analytics, but for those interested in improving their business online!
—JASON BURBY, Chief Analytics & Optimization Officer, ZAAZ, and coauthor of Actionable Web Analytics
Measurement, testing, and constant improvement are at the heart of all successful online marketing campaigns. This book is a detailed and practical guide to using Yahoo! Web Analytics to turbo-charge your business performance. Dennis is eminently qualified to be your guide—he was instrumental in building the software. Get the book before your competitors do!
—TIM ASH, CEO of SiteTuners.com and bestselling author of Landing Page Optimization


Dear Reader,
Thank you for choosing Yahoo! Web Analytics. This book is part of a family of premium-quality Sybex books, all of which are written by outstanding authors who combine practical experience with a gift for teaching.
Sybex was founded in 1976. More than thirty years later, we’re still committed to producing consistently exceptional books. With each of our titles we’re working hard to set a new standard for the industry. From the paper we print on, to the authors we work with, our goal is to bring you the best books available.
I hope you see all that reflected in these pages. I’d be very interested to hear your comments and get your feedback on how we’re doing. Feel free to let me know what you think about this or any other Sybex book by sending me an email at nedde@wiley.com, or if you think you’ve found a technical error in this book, please visit http://sybex.custhelp.com. Customer feedback is critical to our efforts at Sybex.
Best regards,
Neil Edde
Vice President and Publisher
Sybex, an imprint of Wiley

For me, writing a book goes like this. I wake up early Saturday morning and wobble out to the kitchen. I fix bowls of cereal for the girls, who’ve been up for hours for some reason, hit the shower, and get ready for work—writing another chapter.
We’ll put on our jeans and T-shirts, stumble out the door as soon as we can, and on most days, stop by Murray’s Bagels and get some supplies—which include the obligatory Red Bull for me.
Then it’s off to the Yahoo! 18th Street office, where we spend the entire Saturday working before heading home late in the evening. Lather, rinse, and repeat for 5 months.
And finally I can email the final chapter to the amazing people at Wiley!
And for this, I would like to thank Elisabeth, Victoria, and Vibeke for their lovely support.
To everybody else, and you know exactly who you are, thank you so much for your wonderful support in everything I do and in making this book a reality. I would hate to mention anybody by name in danger of actually forgetting some. That wouldn’t be fair!
Cheers :-)

About the Author
Dennis R. Mortensen is a pioneer and expert in the web analytics industry. He is an accredited associate web analytics instructor at the University of British Columbia and a frequent speaker on the subject of analytics and online marketing. Mortensen is an entrepreneur and was the COO of IndexTools until it was acquired by Yahoo! Inc. in May 2008. Today he is Director of Data Insights at Yahoo! and sits on the board of directors at the Web Analytics Association. He maintains the highly popular analytics blog, VisualRevenue.com/blog.

Several years ago, when I was the director of analytics and research at Intuit, I had postulated the 10/90 rule. Simply put, it stated that if you had a budget of $100 (or dinars or rupees or pesos) for online decision making, then you should spend $10 on the web analytics tool and spend $90 on people (the “planet-sized brains” part of the equation).
The rule was derived from my own experience. I had access to a world-class (translation: expensive!) web analytics tool. It was producing 200 reports—all kinds of things were tagged and tracked and hugged. Yet there was very little to show in terms of actionable insights.
The problem, it turns out, was that the tool was simply puking data out. There were finite resources (translation: analysts) available to make sense of the data, and online marketers were simply not able to understand much from the 200 reports. The result? Not much.
Following a deliberative shift in strategy that involved purchasing a significantly cheaper tool (translation: it would not help you into your underwear each day but did give you all the data you needed) and investing in analysts—people who could take that data, make sense of it, and translate it into implementable business actions—the results were impressive.
Fast-forward to today and one important part of the 10/90 rule, the tools part, is not an issue anymore.
You can still buy and find valid productive uses for paid web analytics tools. But they are not mandatory.
You can use completely free world-class web analytics tools from Yahoo!, Google, Microsoft, and others. You can now take your precious budget and focus it all on the big planet-sized brains part.
What this translates into is your chance to be data rich and analysis rich as well!
Yes, yes, I see you jumping up and down saying access to tools, even free ones, is not enough. You are absolutely right.
Web analysis is not free. Your delightful people with planet-sized brains need training and coaching. You’ll still have to “smartify” your online marketers.
My good friend Dennis Mortensen to the rescue!
This book is going to be your starting point and a constant companion on the journey to making sense of all that data you now have access to from your Yahoo! Web Analytics tool.
I have known Dennis for a number of years now. He is smart. He is supremely knowledgeable about online marketing and decision making. He has deep hands-on experience in the world of web analytics (not just pontificating about it but actually rolling up his sleeves and getting jiggy with the data).
He is uniquely qualified to write this book, thanks to him being at IndexTools since its inception.
This book covers the length and depth and breadth of Yahoo! Web Analytics. Chapters 1 and 2 will get you going with all the right buttons to press, and before the end of first part of the book, your website will be lit up like the glorious Christmas tree at Rockefeller Center in New York City, to produce all the data, accurately, that you’ll need.
But of course that is the start of the glory. Reports, segmentation, templates, and customizable dashboards await you. Never again will you produce a dashboard that gets on the “auto delete” list!
Once there you’ll want to forsake sleep completely until you finish the book because search analysis and optimization is as awesome as it sounds. Understanding the value of your content and being truly customer-centric will be well within your grasp.
This book will ensure that your web analysts get off to a flying start and stay smart as they dig deeper into the tool to leverage all the power that lies within. They’ll be able to create custom segments and cross-tabulate data with unique reports (just as I have been doing for the three years that I have been using IndexTools).
I am excited that you have purchased this book. I know you are going to have a ton of fun learning about web analytics. I am positive that by the time you are done with the book, you’ll agree with me that analysis is sexycool.
To infinity and beyond!
Analytics evangelist and author
Mountain View, CA.

My goal is to take you through how you should approach analytics, and in this book we mainly use the application Yahoo! Web Analytics. You will become a true expert in this application by the end of this book. My philosophy is that you should focus on three different but equally important tasks. I have divided the book into three parts to reflect these broad tasks.
Part I, “Advanced Web Analytics Installation,” consists of Chapters 1 through 5. The focus is on data collection.
True competitive advantage in web marketing comes from collecting the right data, but also, and no less important, from configuring your web analytics tool in such a way that you can derive insight from the data. Part 1 features detailed code examples that webmasters or developers can apply directly. Marketing people and executives will learn the opportunities they can demand from this tool.
I also show you how to add reporting dimensions to the predefined report structures for fantastic filtering and segmentation opportunities.
Part II, “Utilizing an Enterprise Web Analytics Platform,” encompasses Chapters 6 through 10, where we focus on reports.
Creating reports is an easy feat, but remember that reports are never better than the data you collect. You need an exceedingly good understanding of how to work with your data.
Part II is less technical than the first part. In it I’ll teach you to use your reporting toolbox to provide targeted answers to specific questions, such as “How much revenue did we make from first-time organic search visitors from Canada last week?” For this and many other questions you’ll encounter, there is no standard report, but you will know how to get this answer and hundreds of others when you’re through with this section.
Part III, “Actionable Insights,” encompasses Chapters 11 through 13 and focuses on how to take action on your data to optimize your web property. Having gone through the effort of implementing the data collection and reporting strategies in Parts 1 and 2, you will have gained enough insight to start an optimization process.
Part III introduces you to optimization using a set of actionable insights. This is merely an appetizer, and the handful of optimizations I present are not, by any means, the only ones you can pursue. But the ideas and attitude behind them can most definitely be copied and carry you down other optimization avenues. Think of this section as an idea catalog. One of the most important questions I tackle in this section is paid search optimization. Always keep your eyes on the money, eh?

Who Should Read This Book?

Anybody interested in web analytics on a detailed level should read this book, in particular if you want to use analytics for website optimization. In my world, that includes people in the following professions: website developers and engineers who are responsible for setting up web analytics; sales and marketing people who are eager to know what they can expect from analytics at this level; and finally, my fellow web analytics and optimization experts who want a fresh angle on how to optimize their websites and truly gain a competitive advantage.
You don’t necessarily have to be a Yahoo! Web Analytics user or client to appreciate this book. However, general knowledge about website management and online marketing is a great benefit. This book does not cover the inner workings of analytics from an IT architectural point of view.

Book Companion Websites

While reading the book and once you have finished it, you are more than welcome to continue your web analytics journey online.
I maintain an active web analytics and online marketing blog, which I will update with features new to Yahoo! Web Analytics as they arrive, new reports as they are introduced, and optimization tips as they come along:
Blog: http://visualrevenue.com/blog/
Book: http://visualrevenue.com/blog/yahoo-analytics-book

Contacting the Author

If you have questions, feedback, or critique, I am eager to hear from you. You can reach me through the blog mentioned earlier, but also through these social media destinations:
And you are always welcome to email me directly at dennis.mortensen@evcrp.com.

Advanced Web Analytics Installation
Yahoo! Web Analytics uses a browser-based system to identify and track visitors through your website. It is able to pinpoint details about visitors, such as where they go and what they do while on your website. Part I of this book is intended to help you identify the successful elements of your web property. You will learn to assign costs to any type of marketing campaign, allowing you to measure return on your ad spending and other metrics. You will also learn how to add reporting dimensions to the predefined report structures for fantastic filtering and segmentation opportunities later.

Getting Started
True competitive advantage in web marketing comes from collecting the right data, but also, and no less important, configuring your web analytics tool in such a way that you get an opportunity to derive insight from the data. In this chapter you will learn how to install Yahoo! Web Analytics and manage projects. You will see examples of data collection grouping such as vertical and horizontal segmentation. Finally, you will learn what a tracking script is and how its data collection flexibility opens opportunities for reporting and analysis.

Competing on Analytics

I am not the one to lecture you about the importance of web analytics or how it works. Since you are reading this book, I expect that you already know the importance and value of using analytics in your business. Instead, I aim to show you how to create a situation where you are able to compete on analytics; that is, to gain a competitive advantage using web analytics. For this to happen, you are simply forced to do more sophisticated analysis than just looking at reports about the number of page views or the number of visits on your web properties, an activity also known as report surfing.
Note: Report surfing, where one looks at reports without a clear agenda, is not only unfortunate web analytics tool-usage behavior, it is one of the greatest sins a web analytics practitioner can do. The phenomenon and a solution suggestion are debated here: http://visualrevenue.com/blog/2007/09/web-analytics-report-surfing-and-how-to.html.
To compete on analytics, you need a sophisticated data collection strategy, because you cannot analyze data that you have not collected. It is that simple. You cannot collect too much data on the behavior of your visitors. You can present and report on too much data, but that is a debate we will undertake in Part II of this book, “Utilizing an Enterprise Web Analytics Platform.”
Yahoo! Web Analytics and other similar applications on the market have achieved a high level of sophistication only by collecting the correct data. Simpler applications that deploy what some call either plain-vanilla- or simple footer tagging offer nothing more than basic insights.
Plain-Vanilla Tagging
This is also known as simple footer tagging. Tagging your complete website by using the provided default tracking script and simply applying that to the footer of your website templates does not collect enough data to create the insights you need to be competitive.
If you are in doubt about the value of collecting data—and bear in mind that I am saying this with my Yahoo! hat on—why do you think that Yahoo!, Google, and Microsoft provide you with free analytics tools? Partly because even the leftover data (aggregated visitor data across multiple websites) provides so much value that it makes up for the cost of giving away the tool. Now imagine the value you can get out of your highly customized, nonaggregated data. Isn’t this just fascinating to think about?
Yahoo! Web Analytics provides industry-standard reporting that includes pooling multiple visits into visitor profiles, differentiating new visitors from returning visitors, applying campaign attribution choices on first touch point and not necessarily last click, and so on. However, I will not be debating the accuracy of these common ways of collecting data, nor will I discuss the inherited challenges of cookie-based tracking. I suggest reading Brian Clifton’s Advanced Web Metrics with Google Analytics (Sybex, 2008) because it has some very good chapters, including in-depth commentary on that topic, explaining the difference between log files and page tagging.
You will be required, when reading the first part of this book, to have some basic understanding of JavaScript, not on a programming level but on a simple customization level. Most of this and the next four chapters are about customizing the standard tracking script, shown here:
<!—IndexTools Customization Code—>
<!—Remove leading // to activate custom variables—>
<script type=“text/javascript”>
//var ACTION=“;
<!—End of Customization Code—>
<!—IndexTools Code v4.00 - All rights reserved—>
<script type=“text/javascript” src=“http://visualrevenue.com/indextools.js“></script><noscript>
<div><img src=”http://stats.indextools.com/p.pl?a=10001277xxxxx&amp;js=no”
width=“1” height=“1” alt=”“ /></div></noscript><!—//—>
<!—End of IndexTools Code—>
This tracking script is what we would call a plain-vanilla tag, simply because it collects the basic information needed on a page on your website. This is also the tracking script that you will use as the foundation and the one you will mold, by applying different variables, into collecting much more interesting information than just the page title, a basic referring URL, or other simple system information.
The previous tracking code is the original tracking script Version 4, and the following is the new updated Version 5 of the tracking script:
<!—Yahoo! Web Analytics - All rights reserved—>
<script type=”text/javascript”
<script type=”text/javascript”>
var YWATracker = YWA.getTracker(“1000123xxxx”);
width=“1” height=“1” alt=“” /></div>
<!—End of Yahoo! Web Analytics Code—>
There is no difference in the type of data that you can collect with the two track script versions, but you should expect to transition to the updated version if you are not already using it. The biggest difference from a deployment point of view is that you no longer set JavaScript variables but call a JavaScript function to do the same.
Throughout the book I will reference this according to the variable and not the function, but the two concepts are interchangeable and are going to give you the same result.
So, making sure we are on the same page, the following code does the same, and I will reference both as setting the value of the variable.
var DOCUMENTNAME=“About us”; // Version 4
YWATracker.setDocumentName(“About us”); // Version 5
Later in this chapter there is a complete list of available custom variables, which can be combined in a number of ways. Chapters 2-5 go through various ways of applying the variables and the rationales for doing so.

Preinstallation Steps

Before I introduce the code implementation, I would like to draw your attention to two important destinations within Yahoo! in regard to analytics. analytics.yahoo.com is the starting point for anything analytics at Yahoo! and also the starting point for more information on Yahoo! Web Analytics (see Figure 1.1).
web.analytics.yahoo.com is the web analytics application domain that you should bookmark for easy access to your reporting interface.
Your first task, if you have not achieved this already, is to have a Yahoo! Web Analytics account created. There are multiple ways of getting an account, and I suggest that you follow the analytics.yahoo.com domain or the accompanying book blog at visualrevenue.com/blog to find the most up-to-date access points. However, let me list a number of places where you will be able to get access to an account:
Yahoo! Web Analytics Partner Networks This is where I suggest you start if you are not affiliated with any of the following Yahoo! offerings.
Yahoo! Small Business Merchant Solutions Included as an automated part of the offering; if you run a store, this is the way to go forward.
Yahoo! Japan For the Japanese market only, but essentially a free-for-all offering.
Yahoo! Buzz Customers If you are an advertiser, you will have the Analytics Package included.
Yahoo! Custom Customers If you are an advertiser, you will have the Analytics Package included.
Y! OS If you are a widget developer, the Dashboards are powered by Yahoo! Web Analytics, so you should in theory have a full account.
Figure 1.1 Anything Analytics at Yahoo!
Figure 1.2 shows an example of where to go to open your Yahoo! Web Analytics account.
Please bear in mind that some user interface and general semantics surrounding Yahoo! Web Analytics might be slightly different, depending on where you get the account. That said, the underlying technology and tracking is exactly the same.
Collecting the first row of data, meaning the very first page view, is fairly simple and does not take much effort. Just insert the tracking script on every page of your website and upload the general tracking script include file (indextools.js) to your web server. That is it, and you are done!
Figure 1.2 Yahoo! Small Business Merchant Solutions
Yahoo! Web Analytics collects and presents data in real time, or more precisely, there is a 7-second delay between visitors viewing your website and the visit being viewable in the reporting interface.
Each project you track is identified by a unique tracking script and a unique tracking script include file. A project is a website or a related group of websites, but I will discuss the idea of data collection grouping later in this chapter. You can find the tracking script template under the Installation tab in Yahoo! Web Analytics.
As I indicated earlier, some understanding of JavaScript is necessary, but for a basic installation, basic knowledge of HTML and JavaScript is useful but hardly needed. You will have to edit your web pages to add the provided tracking script.
And I am most sure that in a lot of cases your job will not consist of editing but merely sending off requirements of specific code that should be added to specific pages. Then your web department will execute! Besides adding the tracking script to all your pages, you need to upload the tracking script include file onto your web server, typically in the root folder. We will be more specific about this in a second, but to reiterate:
1. Apply the provided tracking script to all pages.
2. Upload the provided tracking script include file.
Yahoo! Web Analytics uses a well-defined, browser-based tracking system to identify and track visitors through your website, and it is able to identify details about your website visitors, where visitors go on your site, and what they do while on the site.
Without going into too much detail, let me explain how it works, which will be a good reference for you in understanding what is going on. Upon loading a web page, the browser processes the above-mentioned tracking script, which you applied to all your web pages. This tracking script directs the browser to retrieve a small, invisible pixel from the Yahoo! Web Analytics servers and to process the larger uploaded tracking script include file. By doing so, detailed information about your visitors’ activity is sent back to the Yahoo! Web Analytics databases.
Yahoo! Web Analytics then either sets a new first-party cookie in the visitors’ browser or resets the existing one. The first time a visitor comes to your website, Yahoo! Web Analytics sets a one-year, first-party, persistent cookie in their browser that includes unique visitor information. During the first visit, people are identified as first-time visitors. On subsequent visits, Yahoo! Web Analytics resets the cookie life to one year beyond the date of the visit, and identifies them as a returning visitor for the duration of that visit. If a cookie cannot be set, then the visitor is indentified as a first-time visitor. If the visitor has deleted the cookie, Yahoo! Web Analytics will again identify them as a first-time visitor and reissue a new first-party cookie.
You can define and track further information by applying variables to the tracking script, which is then sent back to the database and subsequently made available for analysis. So to conclude, during a visit, Yahoo! Web Analytics recognizes each time the browser loads a page and thus executes the script, and records yet another page view with all its accompanying metrics. All pages viewed by one visitor are grouped together as one visit, which is also called a session. A session stops after 30 minutes of inactivity. A large pool of the default metrics are collected from what is called the user agent string.
User Agent String
Very simply put, a user agent string is a text field in an HTTP request header that contains information such as name and version of the web browser and operating system.
Here is an example of what a user agent string looks like:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv: Gecko/2008102920
Yahoo! Web Analytics maintains detailed records of every visit to your website in its database, including the information in the user agent string. When you request a report, Yahoo! Web Analytics mines this database to produce real-time reports for any reporting period you selected.

Basic Installation

Now to the meat of the matter—actually installing the tracking script and recording that first page view. Go to the installation part of your account and request the tracking script. Having applied the URL visualrevenue.com when creating the account as the primary website, the tracking script comes out looking like this:
Version 4
<!—IndexTools Customization Code—>
<!—Remove leading // to activate custom variables—>
<script type=“text/javascript”>
//var ACTION=“;
<!—End of Customization Code—>
<!—IndexTools Code v4.00 - All rights reserved—>
<script type=”text/javascript“src=”http://visualrevenue.com/indextools.js“></script><noscript>
<div><img src=”http://stats.indextools.com/p.pl?a=10001277xxxxx&amp;js=no”
width=“1” height=“1” alt=”“ /></div></noscript><!—//—>
<!—End of IndexTools Code—>
It does not mean that the tracking script is dedicated to that specific URL—all it means is that it applied the location of the tracking script include file in the tracking script. This is something you can change yourself by hand if needed. Yahoo! Web Analytics assumes by default that you locate the tracking script include file (indextools.js) in the root folder:
<script type=“text/javascript” src=”http://visualrevenue.com/indextools.js”></script>
The tracking script reference to the root location is something you can modify, should you have restrictions or procedures for where to put JavaScript include files:
<script type=“text/javascript” src=“http://visualrevenue.com/includes/js/indextools.js”></script>
You need to make sure that the physical placement of the file matches your reference.
Here is a summary of the steps for how to install the tracking script:
1. Go to the Yahoo! Web Analytics website and log in to your account.
2. Select the Installation tab and follow the two-page setup process. On the second page, you will receive the tracking script for your website’s pages and a tracking script include file.
3. I strongly recommend that you upload the tracking script include file to the root directory of your web server.
4. Select the Yahoo! Web Analytics tracking script and copy it to the clipboard. Make sure you have selected all the code.
5. Open your HTML page in a text editor and paste the code into the body section of your page, directly above the closing body tag </BODY>.
6. Repeat steps 4 and 5 for every page on your website that you want Yahoo! Web Analytics to track.
Figure 1.3 shows a simple web page as an example: http://visualrevenue.com/.
Figure 1.3 Simple HTML page
Applying these steps and viewing the HTML source for the page will give you a direct idea of where to place the tracking script and how it relates to the rest of the HTML code.
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<title>VisualRevenue | Web Analytics &amp; Online Marketing</title>
<h1 id=“blog-title”><a href=“http://visualrevenue.com/blog/”>VisualRevenue |
Web Analytics &amp; Online Marketing blog</a> </h1>
<p>I believe you are looking for <strong> Dennis R. Mortensen’s</strong>
blog about how to increase revenue through analytics! :-)</p>
<!—IndexTools Customization Code—>
<!—Remove leading // to activate custom variables—>
<script type=“text/javascript”>
var DOCUMENTNAME=’Homepage’;
<!—End of Customization Code—>
<!—IndexTools Code v4.00 - All rights reserved—>
<script type=“text/javascript” src=“http://visualrevenue.com/indextools.js”></script><noscript>
<div><img src=“http://stats.indextools.com/p.pl?a=1000127718971&amp;js=no”
width=“1” height=“1” alt=”“ /></div></noscript><!—//—>
<!—End of IndexTools Code—>
Upgrades to the way Yahoo! Web Analytics collects the data are rarely something that require changes to the tracking script. The upgrades are typically done in the tracking script include file, and all you need to do is upload the newest version to the web server to take advantage of newly introduced data collection features. The reporting updates are done entirely remotely without any action needed from you.
The new Version 5 of the tracking script no longer requires you to upload a tracking script include file, as this is hosted by Yahoo. So it makes the initial deployment of the code a whole lot easier.
Version 5
<!—Yahoo! Web Analytics - All rights reserved—>
<script type=“text/javascript”
<script type=”text/javascript”>
var YWATracker = YWA.getTracker(“1000123xxxx”);
YWATracker.setDocumentName(“About us”);
width=“1” height=“1” alt=”“ /></div>
<!—End of Yahoo! Web Analytics Code—>
Note: Please note that if your website uses frames or Ajax, you are forced to take a slightly different route in applying the code. This topic is covered in later sections.
If your website is secured by SSL (Secure Sockets Layer), you have to use a special tracking script. Under the installation section of Yahoo! Web Analytics, you are given the opportunity to choose between a tracking script for standard HTTP pages including Flash websites and, in general, other normal browser applications, or a unique Yahoo! Web Analytics SSL tracking script. The complete script without any modifications looks like this:
<!—IndexTools Customization Code—>
<!—Remove leading // to activate custom variables—>
<script type=“text/javascript”>
//var ACTION=”;
//var AMOUNT=’USD0.00’;
//var ORDERID=”;
<!—End of Customization Code—>
<!—IndexTools SSL Code v4.00 - All rights reserved—>
<script type=“text/javascript” src=”https://visualrevenue.com/indextools_ssl.js“></script><noscript>
<div><img src=”https://secure.indextools.com/p.pl?a=1000127718971&amp;js=no“
width=“1” height=“1” alt=”“ /></div></noscript><!—//—>
<!—End of IndexTools Code—>
As you probably noticed, the set of variables included in the default tracking script is extended by AMOUNT and ORDERID—even though they are commented out. The reason for this is as noted earlier—just to give you a head start—and they indicate very nicely where you typically would have SSL pages, such as the pages where products are sold.
But more importantly, you will notice that you are required to download the indextools_ssl.js script and place that in your preferred folder and reference this tracking script include file instead of the regular tracking include file.
If your website contains a mixture of SSL and standard pages, then you need to tag each page with the appropriate form of the tracking script. You also need to upload both versions of the include file to the root directory of your web server.

Data Collection Grouping

It is of the utmost importance that you decide on a strategy for grouping the collected data before deploying the first tracking script—there is no opportunity for you to roll back this choice, and there is no feature to untangle unrelated data or group related data at a later stage.
Yahoo! Web Analytics works with a data collection grouping concept called projects. Projects are essentially just data containers that hold any collected data you choose—and you should consider that freedom before you start deploying any tracking scripts.
When you create a project, a new unique tracking script is created, with a unique project ID. Whenever that tracking script is executed, the data is collected in the same project. The tracking script is not domain dependent, and you can deploy the tracking script on completely unrelated domains and, in theory, have it deployed under domains you have no control of, such as third-party partner domains.
There is no technical right or wrong, but I strongly recommend that you replicate organizational company structures. Let’s look at the following example created for ValueClick Inc., a fictional company:
• ValueClick (Company)
• Corporate Marketing
valueclick.com (primary domain)
valueclick.co.uk (domain for the UK)
• Shopping Comparison (Division)
• PriceRunner (Business Unit)
pricerunner.com (domain for the US)
pricerunner.co.uk (domain for the UK)
pricerunner.dk (domain for Denmark)
pricerunner.se (domain for Sweden)
• Etc.
• Affiliate Marketing (Division)
• Commission Junction (Business Unit)
cj.com (primary domain)
uk.cj.com (domain for the UK)
de.cj.com (domain for Germany)
members.cj.com (domains for affiliate application)
And I am sure they have hundreds of domains to complement these and hundreds of vanity domains on top of that as well. As you can see, we are left with a decision as to how to group these domains (what tracking script to place on which domains) and the future reporting implications of those choices. My best advice is to replicate company structures and group not by web domains but by matching goals and thus data similarity. In our ValueClick example, that could look like this:
• Project 1: ValueClick Corporate Marketing Websites
• Project 2: PriceRunner Shopping Comparison Websites
• Project 3: Commission Junction Public Websites
cj.com (primary domain)
uk.cj.com (domain for the UK)
de.cj.com (domain for Germany)
• Project 4: Commission Junction Affiliate Applications
By grouping some 10 PriceRunner countries into one big—and at first sight, messy—pool of data, we create the opportunity to do two types of data segmentation: vertical and horizontal segmentation.
Vertical segmentation means that we can, at any point and on any of the collected data, create a segment based on, say, the dimension Entry Domain (such as entry domain = pricerunner.co.uk for the UK country manager). Or it could be, and probably more correctly so, a segment based on the Dimension of Visiting Countries (Visiting Countries = United Kingdom). See Figure 1.4 to see what this looks like in the Yahoo! Web Analytics Segmentation Wizard.
Figure 1.4 Yahoo! Web Analytics Segmentation Wizard
Horizontal segmentation means that we can create a segment across all domains (and this is one reason why data should be related in a project). For example, segmenting data on the dimension Page URL (such as Page URL = Apple-iPod-Touch-16GB-Black) will give us information about a given product across all countries/domains, allowing access to such information as the visit-to-sale conversion rate compared across countries.
These segments can be applied on all reports and, even more importantly, on dashboard items, which then creates the opportunity to have a set of similar dashboard items (on the same metric or key performance indicator [KPI]). This could be a look at your conversion rate—but for every single country individually, compared to the global average, thus spotting high- and low-performing teams.
Key Performance Indicators (KPIs)
KPIs are promoted metrics, such as cost per new subscriber, that function as communication and steering vehicles for management—or in plain English, the numbers that are important to you! Find a detailed explanation of the difference between a KPI and a metric here: http://visualrevenue.com/blog/2008/02/difference-between-kpi-and-metric.html.
Chapter 7, “Customizing Report Results,” devotes an entire section to segmentation in general, and will explain how to set up and use this functionality.
Even though you might have a set of different projects, you still have the opportunity to create a high-level project rollup, which will create sums on basic metrics, such as page views, across all your projects and also provide a simple tree structure for visual comparison. You can find this feature under the Dashboard menu.
Domain Grouping
Your data collection project strategy is not to be confused with domain grouping. It is quite common to run matching versions of a website under different domain names or vanity domains, such as:
Domain 1: http://visualrevenue.com/
Domain 2: http://visualrevenue.net/
Multiple domains, if not set up correctly, will create suboptimal, and to some extent faulty, reporting in areas such as most popular pages, where you might have duplicates but it is in fact the same page, just served from two different domains.
To avoid this, Yahoo! Web Analytics allows you to group all your different domains under a project, and all of them are treated as the same website. You can find this option under Settings:
This procedure allows you to map each page of your secondary domain to your primary domain and thus ensure the reporting will be amalgamated correctly.
Note that this setting is a rewrite upon data collection and it takes effect immediately after saving it; it is not something that can be changed for previous collected data.
Vanity URL
A vanity URL (unique domain) is typically created by a company as part of an advertising campaign that points to a microsite (you will see this used in offline campaigns the most), with the assumption that it is easier to remember a specific domain name, such as:
Country URL: http://www.hp.com/country/dk/da/welcome.html
Vanity URL: http://www.hp.dk
The rule of thumb is that you should have a good reason to split your data collection into separate projects. Unless you are running very different web properties, you should end up with something like the setup shown in Figure 1.5.
If and when you deploy multiple Yahoo! Web Analytics projects, always make sure that you choose the correct and corresponding project tracking script.
Figure 1.5 Project setup example

Adding and Managing Projects

Keep in mind that in addition to serving as a container for data collected, a project holds and defines a set of properties for the data and their interpretation and reporting visualization.
Depending on your account permission, you can manage anything from one single project to an almost unlimited number of projects. You add new projects under the Settings sections, and this is also where you manage existing projects (see Figure 1.6). Whether you create a new project or edit an existing one, it is the same set of properties that you edit.
Figure 1.6 Project settings
Table 1.1 is a comprehensive list of all the available project settings and their reporting implications.
Table 1.1 List of Available Project Properties
If you need to delete a project, such as in the event of tracking a time-limited campaign or microsite where results and data do not need to be saved for later use, remember that you have to remove the tracking from your website as well.

Tracking Script Customization

You can customize the tracking script to your specific business needs. The tracking script includes JavaScript variables that you can activate in order to collect deeper information about your visitors or to track specific actions and data, such as a document name, a sale action, or the corresponding revenue. In the default Yahoo! Web Analytics tracking scripts is a section marked Customization Code, and within that section you will notice a set of inactivated variables. The leading slashes (//) are JavaScript syntax for commenting; they must be removed to activate the three suggestions. The section in question looks like this:
Version 4
<!—IndexTools Customization Code—>
<!—Remove leading // to activate custom variables—>
<script type=“text/javascript”>
//var ACTION=“;
<!—End of Customization Code—>
Version 5
<!—Yahoo! Web Analytics - All rights reserved—>
<script type=“text/javascript”>
var YWATracker = YWA.getTracker(“1000123xxxx”);
There is no demand that you use these three customization variables (DOCUMENTGROUP, DOCUMENTNAME, and ACTION). They are only provided by Yahoo! as examples and for ease of use in getting started.
There is a full host of variables that I will list later and that we will debate in detail throughout Part I of this book. These variables can be used to collect specific and unique data.
As a quick example of the variables needed in a sales scenario, let’s pretend we want to record a sale with the Order ID of 5001 of two unique products (defined by SKU equaling DM822 and DM092), with three units sold of DM822 at EUR 100.00 a piece and 1 DM092 unit sold at EUR 50.00. The variables needed to collect this information would look like:
Version 4
var ACTION=’01’;
var _S_SKU =’DM822;DM092’;
var _S_UNITS=’3;1’;
var _S_AMOUNTS=’300.00;50.00’;
var ORDERID=’5001’;
var AMOUNT=’EUR350.00’;
Version 5
I would like to confirm once again that it is not an explicit demand that all variables are used, and what you will see in the following chapters are best practice advice and not necessarily technical syntax. The previous example does not, from a technical point of view, need the variables _S_SKU, _S_UNITS, and _S_AMOUNTS if you are not out to analyze individual products. (I, of course, suggest you do, but that is a different story.)
Stock Keeping Unit (SKU)
Stock keeping unit (SKU) is a unique identifier for each distinct product and service that can be ordered from a merchant. The SKU system is rooted in data management, enabling merchants to be in control of their inventory.