Chapter 2. Content and Advanced Conversion Tracking

Yahoo! Web Analytics becomes vastly more valuable after you have exploited actions such as conversion tracking. Having paired actions with intelligent and unique document naming and grouping, you are set to do advanced data analysis. In this chapter you will learn how to paint a detailed picture of your visitors by tracking the following data:

  • Where your visitors came from, including how they were referred.

  • What they did on your website and the specific content they consumed.

  • Whether their mission was accomplished, and if not, where did it fail?

Executing the steps you learn in this chapter will move you far up the professional ladder.

Chapter Contents

Document Names

Document Groups

Track Downloads

Track Exit Links

Track Registered Members

Track Conversion Actions

Track Revenue

Creating Scenarios for Funnel Analysis

Document Names

Yahoo! Web Analytics enables you to assign each page on your website a unique name for the purposes of reporting. This is an override function; you are not forced to use it. If you do not assign unique names to each page, Yahoo! Web Analytics will apply the HTML title tag as the name of the page viewed.

Many users do not make the effort to create a naming strategy for their pages, with the result that they create errors in reporting and forego the ease of creating new reports. I will describe several examples of this problem.

First, any serious search engine optimization (SEO) activity includes optimization on the HTML title tag for the pages in question. With the title tag changing every now and then, the collected and reported-on information will show a new page for every change. So if my HTML title tag changes from:

<title>VisualRevenue | Web Analytics & Online Marketing</title>

to:

<title>Web Analytics & Online Marketing</title>

I will have the same page reported as two distinct pages—which is, of course, extremely bad, both for long-term reporting (yearly or more) as well as short-term reporting (for example, on the effects of SEO activity itself). This is a great example of where we need the DOCUMENTNAME variable. In the previous example DOCUMENTNAME might be set to homepage, which would then be the name no matter how many times we change the title tag.

In a second hypothetical situation, you could choose to keep identical HTML titles on two different pages (where different is defined as two distinct URLs with two different sets of content). Because they have the same HTML titles, those two pages would be grouped together as if they were one, and all views would be counted as one sum.

There are many other examples where you either end up splitting the same page into multiple pages or group different pages into one. There might even be scenarios where you would want to group different pages into one without using document grouping.

Some erroneous reporting is likely to come about unintentionally; an SEO team is not focusing on reporting, a web developer is not focused on titling, and content management systems (CMS) apply automatic templates.

I would like to note that a quick hack—not to be seen as a long-term fix—allows you to always report on URLs, which tend to be unique. Conversely, dynamic URLs are essentially worthless for reporting purposes.

So to conclude, I highly recommend you use the DCOUMENTNAME variable, or at least, that you adopt a clear naming strategy before you start. Beyond accurate data you also get reports that are easier to understand; more rapid report navigation; and optimized use of filters, custom reports, and segments.

Here is how to deploy the DOCUMENTNAME variable on your default page (e.g., yourdomain.com/index.html):

Version 4

var DOCUMENTNAME='Homepage';

Version 5

YWATracker.setDocumentName("Homepage");

Looking at the result of an implementation, you will see the most basic report output, like that shown in Figure 2.1.

Top 10 pages by page title

Figure 2.1. Top 10 pages by page title

Note that your DOCUMENTNAME variable must not be longer than 75 characters and that you must not use non-ASCII characters. In addition, do not use any of the following characters in the name:

' < > # & ; : ? - * ~ ' ' ) ( = % ! "

These and other non-ASCII characters may have a negative effect on the general tracking script and the way it operates. As you remember from Chapter 1, DOCUMENTNAME is provided as an example with the default tracking code but commented out, so remember to remove the leading slashes (//) to activate the variable.

Yahoo! Web Analytics is a real-time system, so you can test your changes to the tracking script by changing the DOCUMENTNAME variable and refreshing the page. You should then see your reporting change.

Document Groups

Document grouping is very valuable, but I would not stress it as much as document naming, because data collecting and reporting can be done accurately and correctly without document grouping. Document groups do, however, create an opportunity to categorize your content for reporting purposes, and I certainly recommend it after document names have been set up.

You can group together similar pages with document groups, such as your entire checkout process, and do reporting and analysis on this group combined. You can create similar groups based on content, such as news and sports, and compare the popularity of these sections in your reports.

You cannot create hierarchical subgroups with the DOCUMENTGROUP variable alone; for this, custom fields are needed. For example, an online publisher might create a Products document group, followed by a subcategory called Books. Details on how to achieve this using custom fields or merchandising can be found in Chapter 4 and Chapter 5.

Use the DOCUMENTGROUP variable in your tracking code to identify each page that you wish to be part of a document group. For example, all your pages that provide news could be identified by the document group name News.

Version 4

var DOCUMENTGROUP='News';

Version 5

YWATracker.setDocumentGroup("News");

Note that your DOCUMENTGROUP variable must not be longer than 75 characters and that you must not use non-ASCII characters. In addition, do not use any of these characters in the name:

' < > # & ; : ? - * ~ ' ' ) ( = % ! "

These and other non-ASCII characters may have a negative effect on the general tracking script and the way it operates. As you remember from Chapter 1, the DOCUMENTGROUP is provided as an example with the default tracking code but commented out, so remember to remove the leading slashes (//) to activate the variable.

Again, please note that there is an opportunity to create further categorization and hierarchies using custom fields. You'll learn much more about this and the other powers of custom fields in Chapter 5, "Advanced Instrumentation."

Track Downloads

There are fundamental differences in collecting data through a JavaScript tracking script and collecting data from web server logs. The reason I mention this is that, regrettably, you have to accept that not every download will be registered. The accuracy of download metrics depends heavily on site structure and marketing reference to the files in question.

I reference the file (notice the extension): http://visualrevenue.com/blog/PDF/Best-Pratices-for-Online-Travel-and-Hospitality.pdf on the following page: http://visualrevenue.com/blog/2007/10/what-and-how-to-measure-online-travel.html. If you provide the HTML web page as a reference for visitors to get the file, and if they indeed click the link provided on that page, Yahoo! Web Analytics will track the click as a download.

It is not a measurement of whether the download was actually started or whether it was completed; it is only a reference point to the fact that someone initiated it. Initiated means clicking the file link in question on the page that you are tracking. Tracking is not associated with the file itself as such.

On the other hand, if you reference the PDF file in your marketing material directly, as in http://visualrevenue.com/blog/PDF/Best-Pratices-for-Online-Travel-and-Hospitality.pdf, Yahoo! Web Analytics will not register this, and usage statistics are lost. This inaccuracy is common to all page-tagging solutions.

The ability to create a reference to the downloadable file is provided out of the box, and you need not do anything else but install the plain-vanilla tracking code.

One interesting result of tracking downloads is that you can create a trended report for a unique file, which looks like the example in Figure 2.2.

Downloaded file trend

Figure 2.2. Downloaded file trend

In this report you are also able to view which pages the files are downloaded from.

The file types in Table 2.1 are registered as page views, including any URL that contains the text jsessionid. All other file types are treated as downloads and presented in the download reports.

Table 2.1. Page View File Types

File Extension

  

.html

.asp

.cfm

.jsp

.cgi

.php3

.php4

.php5

.pl

.taf

.tml

.dll

.vm

.mv

.do

.go

.wem

.tpl

However, if you want to track downloads (that is, download links) as actions, you can do this either directly within the link or as an on-click wrapper function. You'll learn more about action tracking and download extensions in the sections that follow.

Tracking Exit Links

Tracking exit links is, in nature and tracking technology, very similar to tracking downloads. Yahoo! Web Analytics attaches itself to all links. If a link outside of the domain structure is clicked, it is registered as an exit link.

This is one of the advantages of page tagging versus log file analysis, as all exit links are tracked. You are in control of when something is to be registered as an exit link.

The ability to track exit links is provided out of the box, and you need not do anything else but install the plain-vanilla tracking code.

The simplest results of an exit link tracking report look like Figure 2.3.

Top 10 exit links

Figure 2.3. Top 10 exit links

In Figure 2.3 you will notice that the results are grouped by domain and not specific URLs. This is a reporting choice you can make at the time of generation. Another option is to report the pages at which your exit links are located. This option helps you find your exit links and determine possible correlations between high site-traffic leakage and specific content.

As with downloads, if you want to track exit links as actions, you can do this directly within the link or as an on-click wrapper function—we'll look at action tracking and exit link extensions a bit later.

Note that should you use a redirect function to send traffic out to business partners, for example, this is not measured other than traffic to the redirect page. This is a setup where tracking the link as an action might not be a bad idea.

Tracking Registered Members

Using Yahoo! Web Analytics works especially well in an environment where visitors are required to log in or identify themselves through their usual path toward solving their problem. This could be as obvious as the last steps of a sales funnel and checkout process, but also something as innocent as capturing a person when signing up to a webinar.

I am very comfortable in tracking registered members when they are in an environment where they are fully aware that they are being registered. Examples of such environments would be websites such as LinkedIn or Facebook, where users tend to be fully aware that you know who they are. Allowing users explicit opportunities to hand over additional personal identifiable information (PII), or telling them you will be analyzing PII data, helps create a positive consumer attitude toward this type of data collection. Yahoo! has a strict, consumer-friendly attitude toward this and has incorporated that attitude into their Terms and Conditions.

Note

Be aware that Yahoo! requires you to append to your privacy policy wording along the lines of "We use third-party web beacons from Yahoo! to help analyze where visitors go and what they do while visiting our website. Yahoo! may also use anonymous information about your visits to this and other websites in order to improve its products and services and provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by Yahoo!, click here. (/agreement.html)."

I strongly recommend that you be absolutely up front and honest about what data you collect.

To track registered members, you need to apply the variable MEMBERID. This variable cannot be a static variable such as:

Version 4

var MEMBERID='[email protected]';

Version 5

YWATracker.setMemberId("[email protected]");

Rather, the variable has to be populated with the member's identity information at runtime. This means that you and your team are forced to do changes directly in the scripting language behind your website solution, such as PHP or ASP, to make this work. Let me provide an example of how you would populate the MEMBERID variable with the email from a commenter in the popular blogging software WordPress.

Version 4

<!-- IndexTools Customization Code -->
<!-- Remove leading // to activate custom variables -->
<script type="text/javascript">
//var DOCUMENTGROUP='';
//var DOCUMENTNAME='';
//var ACTION='';
var MEMBERID='<?php echo $comment_author_email; ?>';
</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 -->

Deploying a code like the previous snippet will immediately give you access to information on a member level, such as the last visitor details. Figure 2.4 is a sample report showing real-time activity data on a web property.

Note that, just because the previous example and figure focus on a MEMBERID, which equals the user's email, it does not have to be an email. The MEMBERID is essentially just a unique key to identify the member. I have experienced a lot of examples where this is a customer ID number from clients' customer relationship management (CRM) systems. The reasoning for that approach is that you can pair this up with offline data in raw data exports Yahoo! Web Analytics offers.

Last visitor details filtered by the Sale action

Figure 2.4. Last visitor details filtered by the Sale action

As for other variables mentioned thus far in the chapter, the MEMBERID variable must not be longer than 75 characters, and you must not use non-ASCII characters. In addition, do not use any of the following characters in the variable:

' < > # & ; : ? - * ~ ' ' ) ( = % ! "

Part II, "Utilizing an Enterprise Web Analytics Platform," will expand on how to track product use data, but it may be useful to see an example illustrating the value of MEMBERID here. Figure 2.5 shows a custom report, where we have MEMBERID as the left-hand dimension and Revenue as one of the three metrics. You can replace Revenue with other success metrics for non-commerce-based websites. Running the report on today, and sorting the list on Revenue, you get an instant list of top customers. Remember that the system is in real time. A similar report could be run to show daily service actions, such as writing personal emails asking for product satisfaction.

Revenue per MEMBERID

Figure 2.5. Revenue per MEMBERID

Tracking Conversion Actions

Any web property has a set of success criteria, and it is of the utmost importance that these be tracked. Yahoo! Web Analytics defines these success points as actions. These actions can include the following fixed-system actions:

  • SALE

  • INTERNAL_SEARCH

  • PENDING_SALE

  • CANCELLED_SALE

  • PRODUCT_VIEW

  • ADD_TO_CART

There are also custom definable actions that you not only name any way you want, but also assign to a success criterion specific for your web property. Examples of custom-definable actions are:

  • RSS Subscriber Signup

  • Post a Comment

  • Share Content

  • Print

  • New Member Registration

  • Lead Form Signup

Once an action is defined and populated with a value, you get an instant opportunity to run conversion reports, getting insight on behaviors in the context of successful actions. If you define a conversion as a visitor completing an action, you thereby configure a success point. And this is where the power of actions comes into play, as you are now enabled with the opportunity to determine the success of online marketing campaigns, organic traffic, and specific search phrases. Additionally, you can determine the value of user behavior, such as whether more time spent on site does indeed result in more conversions. We will talk much more about the insights derived from actions and conversions in Part II, "Utilizing an Enterprise Web Analytics Platform."

Yahoo! Web Analytics provides nine custom actions beyond the fixed ones out of the box, but technically it holds up to 255 actions, and with a little love from your account manager, you should be able to increase this if needed.

All the fixed actions are named by Yahoo! Web Analytics and will be presented by that name in the reporting system; however, you can name the custom action variables freely. Find these naming opportunities under the Settings menu, shown in Figure 2.6.

Settings for naming actions

Figure 2.6. Settings for naming actions

According to the naming system earlier, you would code an implementation on the Thank You for Requesting Our Catalogue page like this:

Version 4

var ACTION='09';

Version 5

YWATracker.setAction("09");

Action number 9 represents the Request Catalogue action. Wherever actions are available in the reporting system, such as the conversion summary, the action is mentioned by its name (see Figure 2.7).

Conversion Summary report

Figure 2.7. Conversion Summary report

As I indicated in the section on tracking registered members, the goal is not just to collect the data for one unique report, but to collect data for overall use throughout the system. Put yourself in a position where you can do further analysis with yet another metric in your toolbox. Figure 2.8 is an example report showing how many people sign up for your newsletter, grouped by search engine. Each bar in the graph represents a different search engine.

Keep in mind that every time a page on which you have deployed an action is viewed, an action is recorded. This means that you should place this code on success pages and not passing pages, such as the pages toward a goal. It also means that the action typically can be static and not something that needs to be inflated with a value beyond the action number or name.

Newsletter conversions grouped by search engines

Figure 2.8. Newsletter conversions grouped by search engines

When using the fixed action SALE (action number 01), you may also include the additional variables such as AMOUNT or ORDERID, which are then connected to the action in question. I will in detail debate revenue tracking in the "Tracking Revenue" section later in this chapter. But it should be noted that the variables introduced in Chapter 1 are not excluded just because they are in a different category. Content variables can definitely enhance action tracking. Take a look at the following example, where the sale action is deployed together with a page name and a categorization:

Version 4

var ACTION='01';
var DOCUMENTGROUP='Checkout Pages';
var DOCUMENTNAME='Sales Confirmation';

Version 5

YWATracker.setAction("01");
YWATracker.setDocumentGroup("Checkout Pages");
YWATracker.setDocumentName("Sales Confirmation");

I am sure you noticed that an action can be set as unique. I will discuss action naming and visitor count methods later in this chapter.

Tracking Multiple Sales Actions During the Same Visit

This might sound like an inconceivable scenario: having a customer buy a widget, and then within the same visit, having the same customer buy another widget. I am actually quite happy to say that this happens more often than you would think, and to an extent where Yahoo! Web Analytics has developed instrumentation to take advantage of it.

If you track multiple sales on the same page during the same visit, you have to make sure that your ORDERID is unique. If your ORDERID value is fixed, you need to remove the variable altogether as it will otherwise not be recorded by the second sale action.

Keep in mind that this is closely connected to your choices and attitudes regarding how to count conversions in one visit (two sales or just one?). I will explore the topic of visitor conversion count methodology later in this chapter. But as a quick note, if you configure the sale actions on the page with multiple sale actions as Unique, then the reporting interface will display the number of unique sale actions in all the conversion reports. The only exception is the Conversion Summary report, which displays the total number of actions and the number of unique actions.

If you configure the sale actions on the page with multiple sales as not Unique, then the reporting interface will display the total number of sale actions in all the conversion reports. This will increase your conversion rate—not that this is bad, you should just be fully aware of what kind of numbers you are looking at. Therefore, in order to avoid this, I strongly suggest that you always configure the sale action as Unique if you have pages with multiple sales.

Tracking Multiple Occurrences of the Same Action on a Web Page

Now we are ready to move beyond just looking at the visit as a whole, as we've been doing, and into tracking multiple occurrences of the same action on the same page, whether a fixed or a custom action. Once you need to track multiple occurrences of the same action on a web page, you are required to move beyond the fixed tracking script introduced in Chapter 1. You are required to set up a tracking script object—which is super exciting, as you are now able to splash the code around the page as you want. And please take a mental note, as this is down the same alley as tracking more advanced Ajax elements, which we will talk about later in Chapter 5, "Advanced Instrumentation."

Let me show a quick example of how to set up the tracking script object and how to call it. The tracking script function created next, also sometimes called a wrapper function, is completely unique to your site and can be constructed any way you want. So our focus is on tracking multiple occurrences of the same action on the same page (applying two variables wouldn't work):

Version 4

var ACTION='01';
var AMOUNT='USD100.00';
var ACTION='01';    - ERROR, you cannot use the same variable twice
var AMOUNT='USD50.00'- ERROR, you cannot use the same variable twice

So to have two sales, not just in the same visit but on the same page, you could create a wrapper function like this:

Version 4

<script language="Javascript">
function recordsale(orderid, amount) {
       var tracking_object = createITT();
       tracking_object.ACTION = '01';
       tracking_object.ORDERID = orderid;
       tracking_object.AMOUNT = amount;
       tracking_object.submit_action();
}
</script>

Version 5

<script language="Javascript">
function recordsale(orderid, amount) {
var YWATracker = YWA.getTracker("1000123xxxx");
       YWATracker.setAction("01");
       YWATracker.setOrderId(orderid);
       YWATracker.setAmount(amount);
       YWATracker.submit_action();
}
</script>

Here I've created the Version 4 tracking object by writing var tracking_object = createITT(); and then applying the variables needed. I've then executed the tracking script by submitting it: tracking_object.submit_action();. You can extend beyond the three variables I applied here.

Now you know how to create the tracking script object, but bear in mind that no tracking is done unless the function is called from the page itself, as in clicking a link and calling the wrapper function:

<a href='/thankyou.html' onclick='recordaction(23453,100)'>Buy</a>

Or you could choose to create a complete wrapper function including the values and call it once the customer confirms the buy (typically by clicking the Buy button). With this method, everything is included in the tracking script object and it would look like this:

Version 4

<script language="Javascript">
function recordsale(orderid, amount) {
       var tracking_object = createITT();
       tracking_object.ACTION = '01';
       tracking_object.ORDERID = orderid;
       tracking_object.AMOUNT = amount;
       tracking_object.submit_action();
}

recordsale ('orderid 1', 'USD100'),
recordsale ('orderid 2', 'USD50'),
</script>

Version 5

<script language="Javascript">
function recordsale(orderid, amount) {
var YWATracker = YWA.getTracker("1000123xxxx");
       YWATracker.setAction("01");
       YWATracker.setOrderId(orderid);
       YWATracker.setAmount(amount);
       YWATracker.submit_action();
}

recordsale ('orderid 1', 'USD100'),
recordsale ('orderid 2', 'USD50'),
</script>

Here you are forced to inflate the ORDERID and AMOUNT values into the two recordsale function calls in the end to use it correctly.

Tracking Multiple Actions on the Same Web Page

Finally we come to some less strict scenarios, such as the need to record both a sale action and a newsletter signup action on the same web page. This is very much a continuation of the tracking script object debate from the previous section. You could create a wrapper function that looks like this:

Version 4

<script language="Javascript">
function recordaction(actionnumber) {
       var tracking_object = createITT();
       tracking_object.ACTION = actionnumber;
       tracking_object.submit_action();
}
</script>

Version 5

<script language="Javascript">
function recordaction(actionnumber) {
var YWATracker = YWA.getTracker("1000123xxxx");
       YWATracker.setAction(action);
       YWATracker.submit_action();
}
</script>

The good news is that Yahoo! Web Analytics has a shortcut to do this as well. When you need to track multiple actions on the same web page, you can do so by simply adding multiple actions in one request. So the code for the previous example of recording both a sale and a newsletter signup on the same page could look like this:

Version 4

var ACTION="01;02";
var AMOUNT="USD100.00;";

Version 5

YWATracker.setAction("01;02");
YWATracker.setAmount("USD100.00;");

Let's see a more detailed example so you can truly understand the syntax. This example shows how to record a sale action of USD (United States dollars) 100, a newsletter signup, and finally a pending sale of USD 2.50:

Version 4

var ACTION="01;02;PENDING_SALE";
var AMOUNT="USD100.00;;USD2.50";

Version 5

YWATracker.setAction("01;02;PENDING_SALE");
YWATracker.setAmount("USD100.00;;USD2.50");

Whether you assign newsletter signup to action number 02 is up to you, and you might have a different action named for newsletter signup. As we debated in the initial section about tracking conversion actions, you can use the following variables multiple times in one request:

  • ACTION

  • AMOUNT

  • ORDERID

  • _S_TAX

  • _S_SHIPPING

  • _S_DISCOUNT

  • All action-based custom fields. (I will discuss custom fields in Chapter 5.)

I know that we have not yet discussed merchandizing variables, such as _S_UNITS, but it is important to note that they will only refer to the very first action in the previous list.

Tracking On-click Actions

When I say on-click, I am talking about the onclick event registered on your web page objects. This event registers when the object has been clicked and provides you with an opportunity to execute a desired action on that click, such as record it. This is again a continuation of the tracking script object discussion from the previous sections, and you would in fact be able to use the same wrapper function from previous examples for this scenario:

Version 4

<script language="Javascript">
function recordaction(actionnumber) {
       var tracking_object = createITT();
       tracking_object.ACTION = actionnumber;
       tracking_object.submit_action();
}
</script>

Version 5

<script language="Javascript">
function recordaction(actionnumber) {
var YWATracker = YWA.getTracker("1000123xxxx");
YWATracker.setAction(actionnumber);
YWATracker.submit_action();
}
</script>

You could apply that wrapper function as the positive action to take on the onclick event, such as:

<a href="/leadsignup" onclick="recordaction(7) ">Submit Form<>

Remember that the previous wrapper functions do not record anything unless called.

The clicked-on object can be anything from an image, form dropdown, form submit, or just an ordinary web link (a download link or an exit link as well). Yahoo! Web Analytics has a great shortcut for tracking on-clicks like this using something called the s_action function.

When you use the _s_action function, only an action is recorded and not both an action and a page view, which would be collecting poor data, as you will be recording dual-page views. Using the _s_action variable is a two-step procedure.

In step 1, make sure that before positive on-click actions are called, you activate the ACTION variable. In most cases the ACTION variable will be empty.

Version 4

<script language="Javascript">
var ACTION='';
</script>

I'll provide several examples for step 2, which I am sure you can mold into a lot of good uses on your web property.

Version 4

  1. Clicking an image

    Visit my LinkedIN profile <a onclick="_s_action('06')" href="
     http://www.linkedin.com/in/dennismortensen" ><img src="/images/linkedinlogo.gif"></a>
  2. Clicking an ordinary link (see Figure 2.9)

    Subscribe via <a onclick="_s_action('04')" href="
     http://feeds.feedburner.com/WebAnalyticsAffiliateMarketingBlog" > RSS </a>
    Subscribe to RSS Link example

    Figure 2.9. Subscribe to RSS Link example

  3. Clicking a file for download

    Download <a onclick="_s_action('09')" href="
     http://visualrevenue.com/blog/PDF/Best-Practices-for-the-Online
    -Finance-Industry.pdf" > Best Practice White Paper </a>
  4. Clicking an image for mailto action

    <img src="/images/dennis.gif" onClick="location.href='
    mailto:[email protected]'; _s_action('17'),">
  5. Clicking an ordinary link, track multiple actions

    <a href="http://visualrevenue.com/blog/about" onclick="_s_action
    ('17;18;19'),"> onclick with multiple actions</a>

For Version 5, which is a whole lot more flexible, you just create a wrapper function, which you call from the onclick. The following example of clicking an image uses the wrapper from earlier:

Version 5

Visit my LinkedIN profile <a onclick="recordaction('01')" href="
 http://www.linkedin.com/in/dennismortensen" ><img src="/images/linkedinlogo.gif"></a>

Tracking downloads and tracking exit links sections are both done automatically by Yahoo! Web Analytics. However, there might be scenarios where you would want to collect this as distinctive actions instead, for further and more detailed analysis.

To track downloads as actions:

<a href=" http://visualrevenue.com/blog/PDF/
Best-Pratices-for-Online-Travel-and-Hospitality.pdf" onClick="ACTION='05'">

To track exit links as actions:

<a href="http://kaushik.net/avinash/" onClick="ACTION='09'">

Visitor Conversion Count Methodology

As indicated multiple places in this chapter, once you set up an action you have to decide whether it should be treated as unique or not unique in the reporting interface.

The rationale behind providing you with a choice for how you want the actions summed up is that different types of actions require different attitudes on how to sum them up. Even for similar actions, different companies might have different and legitimate reasons for summing up differently.

Envision a scenario where you would want to track downloads of a PDF whitepaper as an action. Using the on-click code example from before:

<a href=" http://visualrevenue.com/blog/PDF/Best-
Pratices-for-Online-Travel-and-Hospitality.pdf" onClick="ACTION='05'">

I suggest that you track it as a unique action by selecting the Unique checkbox when naming your actions, as shown in Figure 2.10.

Unique means that, should a visitor choose to download the whitepaper three times in the same visit, the choice is only counted once. That seems good data quality; the visitor can only read it once.

Unique Actions Setting

Figure 2.10. Unique Actions Setting

Another scenario where you would want to track the action as unique might be a sales lead signup page, where once again, a lead is still just one lead, no matter how many times the visitor signs up.

You should configure an action as non-unique (by leaving the checkbox empty), if every time that a visitor performs the action in question, it is of unique value. A sale would be such a case, where a sale is something that has value every time a visitor performs the action. Another example could be a comment provided to a blog, where every new blog comment might have value and it should be summed up in the system with a number that equals the actual number of comments to the blog.

Please note that this is only a configuration of the reporting interface and does not affect the actual data collection. This means that if four actions have been collected, Yahoo! Web Analytics does indeed hold the four actions, but reports on them depending on your Unique setting, which could be 1, 2, 3, or 4.

Track Revenue

If you run a commerce web property, you would definitely want to track your revenue for a whole host of reasons, such as the ability to use a return on advertising spending (ROAS) metric for campaign performance review, figuring out average value per visit, and in general applying the opportunity to tie in money to any equation you do in the reporting interface. I love working with revenue as a metric, and if not as a metric, at least as a proxy for revenue as it makes everything crystal clear.

We have already seen how to collect revenue, without my explicitly spelling it out, but let's review it here. Revenue is collected as part of the sale action and provided to the AMOUNT variable. So to track $100 in sales, you write the following:

Version 4

var ACTION='01';
var AMOUNT='100';

You probably noticed that I wrote "100" as plain text in the AMOUNT variable, which equals the currency I use to buy sushi around the corner here in Manhattan, also known as United States dollars (USD). But in a global world you will most likely be forced to track a sale in more currencies, track a cost in more currencies, and perhaps even provide a consolidated reporting view in one united currency. Yahoo! Web Analytics provides features for all of the before-mentioned needs. The first one is the quality to track your revenue in more than just USD.

Tracking Revenue in Multiple Currencies

Tracking revenue in multiple currencies is tremendously valuable and super easy to deploy. As we know, recording the revenue of a sale demands that you inflate the AMOUNT variable.

The AMOUNT variable can only be used together with the sale ACTION. In most cases the AMOUNT variable is not a fixed variable, simply due to the nature of the sales process; you do not know what the final sales sum is going to be beforehand.

To set the tracking currency, you simply place the three-letter currency abbreviation directly in front of the revenue amount (see Figure 2.11). A sale of 33.58 British pounds would look like this:

Version 4

var ACTION='01';
var AMOUNT='GBP33.58';

Version 5

YWATracker.setAction("01");
YWATracker.setAmount("GBP33.58");

Remember that just because you see the reporting in GBP, you did not have to collect the revenue in that particular currency.

Currency tracking example

Figure 2.11. Currency tracking example

Table 2.2 is a complete list of all the supported revenue tracking currencies.

Table 2.2. Currencies Supported

Currency Code

Currency

USD

American Dollar

BRL

Brazilian Real

LTL

Lithuanian Litas

LVL

Latvian Lats

MXN

Mexican Peso

CHF

Swiss Franc

JPY

Japanese Yen

PLN

Polish Zloty

CRC

Costa Rica Colon

HUF

Hungarian Forint

RSD

Serbian Dinar

HKD

Hong Kong Dollars

SEK

Swedish Krona

SGD

Singapore Dollars

INR

India Rupees

CZK

Czech Koruna

TRY

Turkish Lira

KRW

South Korean Won

ZAR

South African Rand

CAD

Canadian Dollar

AUD

Australian Dollar

EUR

Euro

BGN

Bulgarian Lev

GBP

British Pounds

NZD

New Zealand Dollar

CNY

Chinese Yuan Renminbi

DKK

Danish Krone

RON

Romanian New Leu

EEK

Estonian Kroon

NOK

Norwegian Kroner

RUB

Russian Rouble

HRK

Croatian Kuna

ISK

Iceland Krona

THB

Thai Baht

ISL

New Israeli Sheqel

SKK

Slovak Koruna

UAH

Ukraine Hryvnia

When using a commerce system or basic shopping cart, the value is likely to be inflated into the tracking code dynamically. The following example shows a sample tracking script with the AMOUNT variable inflated with two local commerce system variables named ccode and saleamount. Any local variables are unique to your commerce system.

Version 4

var ACTION="01";
var AMOUNT="<%ccode%><%saleamount%>" //(could equal:: VAR AMOUNT="USD100.00");

Version 5

YWATracker.setAction("01");
YWATracker.setAmount("<%ccode%><%saleamount%>");

Be aware that even though your revenue is tracked in your desired currency, the currency property of the project might override this in the reporting interface. If you set your default currency for the project to USD, all your campaign figures, sales figures, and other revenue tied in figures are converted to this currency.

Yahoo! Web Analytics uses monthly average exchange rates to convert the currencies into the project default reporting currency. This is important to know when you're trying to align the numbers with offline numbers. This means that a quarterly revenue report is calculated by the three months sums by the average currency value for those three months. However, any reporting user with administrator rights can override the default reporting currency and select a specific reporting currency. You can change your default currency under Settings > Personal Setup.

Once you select a user-defined reporting currency, all your reports except the Sales Details report will be displayed in your chosen currency. The figures displayed in the user-defined reporting currency are calculated in the same way as the figures in the project default reporting currency: by multiplying the revenue numbers obtained in the tracking currency with the monthly average exchange rates.

The AMOUNT variable holds all the characteristics of variables in general and can therefore not be longer than 75 characters. You must not use non-ASCII characters in the variable name and refrain from using any of the following characters as part of the value:

' < > # & ; : ? - * ~ ' ' ) ( = % ! "

As a final note and as a tradition throughout the system, you have access to the raw data collected—which for this section means the initial currency of the sale, also known as the tracking currency, no matter what the reporting interface is set to. This is to be found in the Sales Details report.

Track Order ID

You have seen ORDERID introduced on several occasions before this section, simply because it is so closely tied into the sale ACTION and the AMOUNT (revenue) variable.

As with the AMOUNT variable, ORDERID is simple to deploy. It provides you not only with the opportunity to put sale activity in order, but also with the ability to truly utilize your exported raw data and have this tied directly into your CRM system. But even beyond that, you are provided with other opportunities, such as multiple sales in one session.

Tracking the ORDERID variable for a commerce site is almost obligatory, as this can improve the accuracy of monitoring your sales in both systems, making sure that there are no duplicate orders captured during a visit. This also shows why ORDERID is heavily used by the Yahoo! support teams when troubleshooting issues with revenue and sales tracking in general.

Furthermore, if you become advanced enough to use the application programming interface (API), ORDERID is absolutely necessary as a key to that system.

As you can see in the next example, the ORDERID variable goes hand in hand with the sale ACTION from a technical point of view, and from a rational point of view, the AMOUNT variable.

Version 4

var ACTION='01';
var AMOUNT='USD19.95';
var ORDERID='10099801';

Version 5

YWATracker.setAction("01");
YWATracker.setAmount("USD19.95");
YWATracker.setOrderId("10099801");

I think this is my last time repeating the general note that an ORDERID variable must not be longer than 75 characters and that you must not use non-ASCII characters. In addition to that, do not use any of the following characters in the name:

' < > # & ; : ? - * ~ ' ' ) ( = % ! "

These and other non-ASCII characters may have a negative effect on the general tracking script and the way it operates.

Revenue Encryption

Yahoo! Web Analytics has designed a feature that allows you to avoid passing on your revenue in clear text over the Internet, for those clients and situations that warrant such a decision. In most cases, though, having a sale of $19.95 would look like this example:

Version 4

var ACTION='01';
var AMOUNT='USD19.95';

Version 5

YWATracker.setAction("01");
YWATracker.setAmount("USD19.95");

The information was transferred freely over the Internet as part of the checkout process. Remember that just by looking at the figure in your browser, it has been sent from the web server to the client. However, there might be situations where your revenue is not public knowledge. Imagine a shopping comparison site, such as Kelkoo (shown in Figure 2.12), which provides a free service for all its users to compare prices on a given product.

Kelkoo comparison price listing for laptops

Figure 2.12. Kelkoo comparison price listing for laptops

Figure 2.12 shows prices for Sony laptops, but that does not mean that Kelkoo sells any of these products. Their business model, like any other shopping comparison site, is to charge on the click-out to the retailer, quite similar to a paid search. Therefore, the revenue Kelkoo generates by having a visitor click a retailer and go to their site is indeed confidential information. It's the same as if I go to Google and search for digital cameras—I would not know what the true cost per click is on any of the text ads.

This is not the only scenario. Many businesses offer a free service to consumers, and revenue is generated as a business-to-business activity. Here you would simply not want to pass the revenue figures in plain text through the Yahoo! Web Analytics tracking code. This technique will also prevent robots and spiders alike from gathering competitive intelligence on your website's revenue, margins, or general agreements with affiliates.

Revenue encryption is not automatically applied to all accounts, and you would have to request that it be added through the Yahoo! support organization. You are required to provide at least one encryption key, an element that I will discuss in a moment. Once the Yahoo! Web Analytics team has applied this key to the data collection service, you are ready to submit revenue in encrypted form.

I know this explanation is going to be a bit hairy, but it is unfortunately the only way to achieve what we are looking for. The first thing you should be aware of is that Yahoo! Web Analytics currently only supports encryption in the industry-standard Advanced Encryption Standard (AES) in Cipher Feedback (CFB) mode.

The key length should be a minimum of 16 and a maximum of 32 characters, and it must be a multiple of 8. You may supply an arbitrary number of keys to be used during decryption, but you must select one for each given amount.

To recap, collecting a USD19.95 sale, I would apply the following variables:

Version 4

var ACTION='01';
var AMOUNT='USD19.95';

This is where the change is going to happen when we want to use revenue encryption. The first thing you have to do is start all AMOUNT variables with AES (which is case sensitive) and follow that by the key ID number. You are allowed to have up to 10 different keys. And finally, as the third part of the AMOUNT variable, apply a colon character (:) and the encrypted data. This should result in a variable looking like this:

Version 4

var ACTION='01';
var AMOUNT=
 "AES1:F8A0998CAAC1C58145828B4318EB341268300CE0AAECC55A7E9BCA59BD2
43905A58F0944570D78DCA39DF6A8E74C867D"

Version 5

YWATracker.setAction("01");
YWATracker.setAmount("AES1:F8A0998CAAC1C58145828B4318EB34126
8300CE0AAECC55A7E9BCA59BD243905A58F0944570D78DCA39DF6A8E74C867D");

Here's a direct installation manual-like example to get you started:

  1. Get the revenue amount, including the currency, as you would normally.

  2. Embed the prepared revenue string into a 40-character random string at a random starting position; however, the position should be at least 4.

  3. Specify the starting position of the currency in the first two characters of the string and the length of the complete revenue string (including the currency code) in the third and fourth characters of the string. If you put the revenue string at position 4 and we use the previous AMOUNT variable of USD19.95, this would be 0408.

  4. Append a hexed 32-bit cyclic redundancy check (CRC) value to the string (this would be 8 characters). Calculate the CRC for the entire 40-character string, including the prefix. The resulting string should be 48 characters.

  5. Encrypt the entire string using AES in CFB mode.

  6. Hex the entire encrypted data. The result should be 96 characters.

Here's a detailed Version 4 example, applying the steps outlined earlier:

  1. First you get the revenue amount and currency as usual, such as:

    var AMOUNT='USD19.95';

    This leaves us with an eight-character-long revenue and currency string value of:

    USD19.95
  2. You then choose a random 40-character long string such as:

    DENNIS7890123456789012345678901234567890
  3. You then position (overwrite) the revenue and currency string within the random string anywhere you want, just not in the first four characters, like this:

    DENNIS78901234567890USD19.95901234567890

    In this example, we positioned it randomly at character 20 and overwrote eight characters.

  4. We then write this into the first four characters of the string:

    2008IS78901234567890USD19.95901234567890
  5. Then you calculate a 32-bit CRC value for the entire 40-character-long string and hex it. The CRC value for our string is:

    C5601867
  6. The CRC value is then appended to the end, to create a 48-character-long string, looking like this:

    2008IS78901234567890USD19.95901234567890C5601867
  7. And this is the string that you should encrypt with AES. A 16-character-long encryption key like the following:

    DENNISRMORTENSEN

    will result in an encrypted and hexed string like this:

    8E14F3D8742B2216269F2D7CBED00819C29D3B6D99E201F0DFB0FF87451
    C5FEC3FEED38FF4327F40215EF5DA5353876B

    This is the value you would use in the AMOUNT variable:

    var ACTION='01';
    var AMOUNT=
     "AES1:8E14F3D8742B2216269F2D7CBED00819C29D3B6D99E201F0DFB0FF87451
    C5FEC3FEED38FF4327F40215EF5DA5353876B"

    Version 5

    YWATracker.setAction("01");
    YWATracker.setAmount("AES1:8E14F3D8742B2216269F2D7CBED00819C29D3B6D99E20
    1F0DFB0FF87451C5FEC3FEED38FF4327F40215EF5DA5353876B");

Long-winded, yes? Worth it? In a situation where you would not want to disclose your revenue data, surely! Now on to something a bit more down to earth: setting up fixed funnels for analysis.

Creating Scenarios for Funnel Analysis

Traditional funnel analysis is called scenario analysis within Yahoo! Web Analytics, which provides two types of scenario analysis: predefined scenarios and ad hoc scenarios.

I will discuss predefined scenarios here and leave the remainder of the discussion for Chapter 10, "Distinctive Reports and Usage," where I will be discussing how we can use scenarios for in-depth funnel analysis and what kind of insights we will be getting from it.

I bring up scenario analysis at this point because it is common to see web analytics software require you to append the tracking code with funnel step variables in order to set up the funnel.

In Yahoo! Web Analytics, you are not required to append anything to the tracking code and all setup is done within the reporting tool itself. Ad hoc scenarios are done on the fly and do not require any setup whatsoever. Creating predefined scenarios helps you increase reporting speed, and it requires that you use more than eight steps in the funnel. If you are running a web property that is anything below 10 million page views a month, predefined scenarios will not help too much, and I suggest that you just go ahead and use ad hoc scenarios when needed.

On a conceptual level, scenarios are defined as a set of steps moving toward a goal that you have in mind. The first thing you do is apply a set of simple properties to your predefined scenario, as shown in Figure 2.13.

Scenario setup

Figure 2.13. Scenario setup

Then you apply the steps as a simple set of criteria met on one of the following metrics:

  • Page title

  • Page URL

  • ACTION

Continuing the example in our previous figure, which asked for a funnel visualizing the falloff from blog post visits to RSS subscribers, we could define two simple steps, as you can see in Figure 2.14.

Defining steps for a new scenario

Figure 2.14. Defining steps for a new scenario

You would have to filter out first-time visitors before displaying the data in a report (see Figure 2.15). Also, the action defined as RSS subscribers should be evaluated to see whether it would be a good proxy for actual RSS subscribers. We'll go into more detail on scenarios and general funnel analysis in Chapter 10.

Scenario result report

Figure 2.15. Scenario result report

You can create up to 200 different scenarios, which should be enough to satisfy even the most exacting analyst.

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

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