Chapter 1. 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.

Chapter Contents

Competing on Analytics

Preinstallation Steps

Basic Installation

Data Collection Grouping

Adding and Managing Projects

Tracking Script Customization

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.

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 DOCUMENTGROUP='';
//var DOCUMENTNAME='';
//var ACTION='';
</script>
<!-- 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&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"
src="http://d.yimg.com/mi/ywa.js"></script>
<script type="text/javascript">
var YWATracker = YWA.getTracker("1000123xxxx");
//YWATracker.setDocumentName("");
YWATracker.submit();
</script>
<noscript>
<div><img
src="http://a.analytics.yahoo.com/p.pl?a=1000123xxxx&js=no"
width="1" height="1" alt="" /></div>
</noscript>
<!-- 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 25 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.

Anything Analytics at Yahoo!

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!

Yahoo! Small Business Merchant Solutions

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.

Here is an example of what a user agent string looks like:

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.4) Gecko/2008102920
 Firefox/3.0.4

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 DOCUMENTGROUP='';
//var DOCUMENTNAME='';
//var ACTION='';
</script>
<!-- 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&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/.

Simple HTML page

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">
<html>
<head>
<title>VisualRevenue | Web Analytics & Online Marketing</title>
</head>
<body>
<center>
<BR>
<h1 id="blog-title"><a href="http://visualrevenue.com/blog/">VisualRevenue
 | Web Analytics
 & Online Marketing blog</a> </h1>
<para>I believe you are looking for <strong> Dennis R.
 Mortensen's</strong> blog about how to
 increase revenue through analytics! :-)</para>
</center>
<!-- IndexTools Customization Code -->
<!-- Remove leading // to activate custom variables -->
<script type="text/javascript">
var DOCUMENTNAME='Homepage';
</script>
<!-- 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&js=no" width="1" height=
"1" alt="" /></div></noscript><!--//-->
<!-- End of IndexTools Code -->
</body>
</html>

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"
src="http://d.yimg.com/mi/ywa.js"></script>
<script type="text/javascript">
var YWATracker = YWA.getTracker("1000123xxxx");
YWATracker.setDocumentName("About us");
YWATracker.submit();
</script>
<noscript>
<div><img
src="http://a.analytics.yahoo.com/p.pl?a=1000123xxxx&js=no"
width="1" height="1" alt="" /></div>
</noscript>
<!-- 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 DOCUMENTGROUP='';
//var DOCUMENTNAME='';
//var ACTION='';
//var AMOUNT='USD0.00';
//var ORDERID='';
</script>
<!-- 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&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)

      • Etc.

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

    • valueclick.com

    • valueclick.co.uk

  • Project 2: PriceRunner Shopping Comparison Websites

    • pricerunner.com

    • pricerunner.co.uk

    • pricerunner.dk

    • pricerunner.se

  • 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

    • members.cj.com

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.

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.

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.

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.

Project setup example

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.

Project settings

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

Setting

Implication

Web Site Title

Specifies the friendly name of the project used throughout the system, including scheduled reports.

Web Site URL

The primary domain and the one you see your data grouped around. This setting does not prevent you from using the tracking script elsewhere.

Character Encoding

Specifies how Yahoo! Web Analytics is to interpret the collected data. You can leave the default setting or consult your web development department for the encoding of your web properties.

Estimated Pageview

This setting is legacy and intended for capacity planning purposes. It has no impact on the functioning of your account.

Time Zone

This setting is used to determine how to split days when reporting. It should be set to the primary time zone of the corporation. However, any single user can set a time zone and have individual reporting on it, such as a regional manager with regional needs.

First Day of the Week

Basic calendar formatting; used for splitting week views.

Exclude Browser

To ensure that you have as accurate data as possible, I strongly suggest you choose to exclude your own visits, unless needed for testing purposes. You want real visitors with real intent in your data. You would usually enable this setting if you have a dynamic IP address and cannot be part of the IP Filtering setting. This setting is based on cookies, and you therefore need to have cookies enabled to use this function.

IP Filtering

This setting is a typical companywide exclusion of all visits from either one fixed IP address or a complete range of IPs. You can apply multiple lines of IP ranges. Note that IP Filtering affects the data stored and cannot be reversed as with other settings.

Default Report Period

You set Default Report Period to the typical reporting period (day, week. or month) as a simple setting to optimize your daily use of the system.

Default No. of Rows

You set Default No. of Rows to the typical reporting period (10, 25, 50, or 100) as a simple setting to optimize your daily use of the system.

Project Default Reporting Currency

You can choose one projectwide reporting currency, which can be independent of both cost currency and revenue currency. This setting affects all your campaign and revenue figures (except for the Sales Details report, which will still be a line item report). I will discuss the currencies supported and the currency conversion system in Chapter 4. "Merchandising Tracking and Reporting." As with time zones, any single user can set a default reporting currency and have individual reporting on it, such as a regional manager with regional needs.

Chart Format

Yahoo! Web Analytics provides Flash chart visualizations by default, but you can choose to revert the chart format back to PNG. The reason for doing so is typically either incompatibility or more often the need to copy charts for use elsewhere.

Display Comparative Values as Percentages

Leaving this option unchecked will provide you with comparative values displayed numerically.

Automatic PPC Time Zone Adjustment

Adjust the time zone of your pay-per-click (PPC) campaigns to the search engine's local time zone (e.g., Google: PST, Yahoo! US: PST, Yahoo! UK: GMT, Miva UK: GMT) in order to be able to accurately match up click and cost metrics.

Enable Cost Projection

Due to the search engines' inability to report metrics (e.g., impressions, clicks, and most importantly, cost) on the same day, Cost Projection provides you with an opportunity to populate current-day averages based on those of the previous day. Otherwise, your search engine cost–associated data will be zero. More about this subject in Chapter 3, "Enterprise Campaign Tracking."

Project Go-Live Date

This is a onetime off setting that you use only when you initially deploy a project. It provides you with the opportunity to do testing and collect data in a staging phase and before rolling it out on the real site or before the campaign got started. The Project Go-Live Date setting allows you to eliminate the period for which you do not want any data to be displayed and thus provides an accurate picture of real visitors with real intent. The data you choose to eliminate from your reports is not lost, though; this is just a reporting setting.

Report Cache

If you have a high-volume website in the ten or even hundreds of millions of page views per month, the Report Cache can store your most recently accessed reports and metrics and serve them from cache to all your account users, resulting in significantly faster loading times.

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 DOCUMENTGROUP='';
//var DOCUMENTNAME='';
//var ACTION='';
</script>
<!-- End of Customization Code -->

Version 5

<!-- Yahoo! Web Analytics - All rights reserved -->
<script type="text/javascript">
var YWATracker = YWA.getTracker("1000123xxxx");
YWATracker.setDocumentName("");
YWATracker.submit();
</script>

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

YWATracker.setAction("01");
YWATracker.setSKU("DM822;DM092");
YWATracker.setUnits("3;1");
YWATracker.setAmounts("300.00;50.00");
YWATracker.setOrderId("5001");
YWATracker.setAmount("EUR350.00");

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.)

Note that whenever we talk about variables, I have chosen not to list the full tracking script again and again, but only focus on the actual variable you need to insert. The reason is not just to shorten the text, but also because your specific needs and use might force you to use a combination of variables, which then makes listing full tracking scripts of little use.

As a final note, you can add (depending on your account) a free-form field that can expand the reporting capabilities of Yahoo! Web Analytics immensely by applying your specific reporting categories to the predefined structures already available. You can use a free-form field to mirror critical business metrics. For example, if you are in the hospitality industry, you could collect data on travel destination, travel source, ticket type, length of stay, and member level. The collected data could then be used as dimensions in the system for when you create custom reports.

Imagine the power you have in choosing the right online campaign if you know that previous visitors typically went for business class or longer stays. This truly moves you beyond looking at clicks, page views, and visits. I will go into more detail on the power of custom fields in Chapter 5, "Advanced Instrumentation."

Table 1.2 contains a list of variables that are all extensions. The use of variables should be seen as data collected on top of the data collected out of the box without applying any variables, such as a referring URL, country of origin, or search phrase.

I uploaded an eight-page reference of all available metrics and dimensions here:

http://visualrevenue.com/blog/PDF/yahoo-analytics-metrics-groups.pdf

I would also like to note that beyond the default metrics collected, and beyond the enhancement through custom variables or even custom fields, you can further enrich the dataset by either configuring categorization within Yahoo! Web Analytics or by uploading additional data such as merchandising categorization beyond what's collected. You'll learn more about categorization later in the book.

Finally, before checking out the custom variables in Table 1.2, please note—and this will, of course, be visible in my follow-up examples later—that:

  • All variable names are case sensitive. (Note that custom fields are always lowercase.)

  • A variable cannot be longer than 75 characters.

  • You must not use non-ASCII characters in variable names. Do not use any of the following characters in the name: '<>#&;:?-*˜`′)(=%!". These and other non-ASCII characters may interfere with the operation of the tracking script.

Table 1.2. List of Available Custom Variables in Version 4

Name

Value

DOCUMENTNAME

Assign titles to your web pages for reporting purposes.

DOCUMENTGROUP

Group web pages for reporting purposes.

MEMBERID

Assign member IDs to your visitors.

ACTION

Set custom actions (goals); naming is done as a setting.

AMOUNT

Set revenue total sum.

ORDERID

Set the order ID of a purchase.

_S_TAX

Set the tax value on a visitor's purchase.

_S_SHIPPING

Set the shipping charges on a visitor's purchase.

_S_DISCOUNT

Set the potential discount on a visitor's purchase.

_S_SKU

Set the unique SKU for specific products sold. Other information is uploaded.

_S_UNITS

Set the number of units sold.

_S_AMOUNTS

Set the individual revenue if multiple items were sold in the same purchase session.

_S_RUN

If you set this variable to false, the automatic execution of the tracking script will be disabled. (Usually used on sites with frames.)

_s_cfxx (_s_cf01, _s_cf02)

This variable allows you to use custom fields and to add your specific tracking variables to the standard variables already available in the system.

_S_CMPQUERY

This variable allows you to track the URL of a referring campaign even though the website is set to remove the tracking string.

DOMAINS

This variable helps you track websites that have different subdomains and third-level domains. If you set the variable DOMAINS to equal wildcard (*) + the main domain name, e.g., var DOMAINS='*.abc.net', all the subdomains will not be counted as exit links but as part of the main domain.

FLASHURL

This variable is used for recording the location of the Flash object. This variable should be used when the location of the Flash object cannot be determined by the URL

As noted earlier, I am referencing both the variables in Version 4 and the functions in Version 5 as variables throughout. In Table 1.3 you will find a reference list of available functions in Version 5.

Table 1.3. List of Available Functions in Version 5

Name

Value

YWATracker.setDocumentName("xxx");

Assign titles to your web pages for reporting purposes.

YWATracker.setDocumentGroup("xxx");

Group web pages for reporting purposes.

YWATracker.setMemberId("xxx");

Assign member IDs to your visitors.

YWATracker.setAction("xxx");

Set custom actions (goals); naming is done as a setting.

YWATracker.setAmount("xxx");

Set revenue total sum.

YWATracker.setOrderId("xxx");

Set the order ID of a purchase.

YWATracker.setTax("xxx");

Set the tax value on a visitor's purchase.

YWATracker.setShipping("xxx");

Set the shipping charges on a visitor's purchase.

YWATracker.setDiscount("xxx");

Set the potential discount on a visitor's purchase.

YWATracker.setSKU("xxx");

Set the unique SKU for specific products sold. Other information is uploaded.

YWATracker.setUnits("xxx");

Set the number of units sold.

YWATracker.setAmounts("xxx");

Set the individual revenue if multiple items were sold in the same purchase session.

YWATracker.setCF(1, "xxx");YWATracker.setCF(2, "xxx");

This variable allows you to use custom fields and to add your specific tracking variables to the standard variables already available in the system.

YWATracker.setCmpQuery("xxx");

This variable allows you to track the URL of a referring campaign even though the website is set to remove the tracking string.

YWATracker.setDomains("xxx");

This variable helps you track websites that have different subdomains and third-level domains. If you set the setDomains function to equal wildcard (*) + the main domain name, e.g., YWATracker.setDomains("*.abc.net"), all the subdomains will not be counted as exit links but as part of the main domain.

YWATracker.setFlashUrl("xxx");

This variable is used for recording the location of the Flash object. This variable should be used when the location of the Flash object cannot be determined by the URL.

YWATracker.setISK("xxx");

This variable is used to track internal search phrases and has to be inflated on the internal search results page.

YWATracker.setISR("xxx");

This variable is used to track the number of internal search results and has to be inflated on the internal search results page.

I expect by now that you have a clear understanding of what the tracking script is, its flexibility, and the vast opportunities for reporting and analysis, given this type of enhancement. We have yet to explain it in detail, so let's quickly move on to content and advanced conversion tracking in the next chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.216.74