Yahoo! Web Analytics Blog

Adding Customization to Actions in YWA

The following post is by Yahoo!’s Tim Hampshire, he is a YWA Account Manager and Support Specialist.

Actions are a powerful feature of YWA that allow you to track conversion events that take place on your site.  Currently YWA allows you create up to 50 of these custom actions which you can quickly run out of if you do not define them with care. In this post we will demonstrate how to use Custom Fields to store additional information about your actions in order to avoid overusing the limited number of  actions available in YWA.

How Not To Use Actions in YWA

Let’s suppose we are working on setting up YWA on a cooking site where the users can view flash video presentations for each of the recipes on the site.  For the reporting, we are interested in seeing how often each one of these videos are viewed.  One way of accomplishing this would be to define an action for each individual video:

  • Action 11: “apple pie desert recipe video view”
  • Action 12: “strawberry pie desert recipe video view”
  • Action 13: “custard pie desert recipe video view”
  • Action 14: “blueberry pie desert recipe video view”
  • Action 15: “raspberry pie desert recipe video view”

The number of actions used could also get compounded by cycling through the various forms of each recipe:

  • Action 16: “apple flan desert recipe video view”
  • Action 17: “strawberry flan desert recipe video view”
  • Action 18: “custard flan desert recipe video view”
  • Action 19: “blueberry flan desert recipe video view”
  • Action 20: “raspberry flan desert recipe video view”

Using this method of defining actions we would very quickly find ourselves running into YWA’s limit of 50 custom actions. We also might find that adding extra categories to these actions would be laborious and potentially error prone.

The Correct Usage of Actions in YWA

When creating actions in YWA, you will want to define them as broadly as possible so that they can be used on multiple locations of your site.  We can then use Custom Fields to capture detailed information about the specifics of the action performed.  Using Custom Fields with our actions in this way will add the detailed classification and grouping information we are looking for when running granular reports in YWA.

Continuing the cooking site example above, we could define one action to register the viewing of a recipe video, we’ll call it “recipe video view”:

Action Naming

Then we will want associate three Custom Fields with our action that will capture the details about the cooking video’s “course”, “form” and “flavour”:

CF Naming

When setting up these Custom Fields (CFs) we must be sure to use the correct type of association or scope for the CF.  In this example we will want the CFs to be associated with the action, and so we will use ‘action scope’ so that the CF will be correctly associated with the action.  We will also choose the ‘string’ types as we will want to store alphanumeric strings category groupings rather than just numeric.

Setting up the Tracking Code

Now that our action and Custom fields are setup, we will have to modify our tracking code in order to capture the data.  Let’s say that we have a recipe for Apple Pie on our cooking site.  Every time the video for this recipe is viewed we will want to execute the following tracking code:

YWATracker = YWA.getTracker(“10001234567890123”);
YWATracker.setCF( 17 , "desert");
YWATracker.setCF( 28 , "pie");
YWATracker.setCF( 29 , "apple”);
YWATracker.setAction("12");
YWATracker.submit_action();

Every time this tracking code is executed it will register a “recipe video view” action and associate “desert”, “pie” and “apple” with the action through the corresponding Custom Fields.

Running the Reports

We can now generate a custom report using action based Custom Field or Custom Fields as groups and the action of viewing the recipe action as the metric.

Custom Report Wizard with Action Scope CFs and Action 12 Metric

If we are interested in just a single category type of one of our chosen classification CFs we can add a cross reference filter such as ‘Form’ equals ‘pie’ , where form is the action scope CF we labeled as form, to represent the sub type of food, and in this example ‘pie’ to filter for pies only.

Here is an example of such a report.

Custom Report: Video Views for Pies

In this report we are actually using several custom fields as group classifications and filtering for the form is ‘pie’ only.  Alternatively we could choose to rearrange the group order in the custom report wizard to list flavours first such as:

Custom Report: Video Views for Pie Flavours

Filtering on Custom Fields used as categories

Once you have setup your custom fields CFs to customize your actions, you can then choose to filter on these categorizations added to some actionable user event.  These CF filters are selected in the add filter section from the drop down list custom field, here is where these filters are found,

Custom Field Filters

Here is an example of these filters where we are ORing together  strawberry and raspberry flavour filters and ANDing this with pie form to list raspberry or strawberry pie recipe video view numbers.

Custom Report: video views for strawberry or raspberry pies

Using Custom Fields to Add Timing Classification.

You can also use CFs for section of day reporting if wanted – down to the minute if needed – or even second.

This could be useful for example to tie in some radio or television advert specific time of day with user responses from the internet to the associated television or radio marketing campaign.

To do this you just need to set another CF to the time of day in sections of time of day rounded to sections of time your are interested in, for example 15 minutes or 30 minute sections.

So if you would want to know which quarter of an hour the action occurred in, then you can round the time down to quarter of an hour intervals and pass this to a CF.  If this was to be used with the above example of an action of selecting a video view of a recipe, then again action scope and either string or numeric type would be chosen.

In this example we have chosen to use a string type as we want to store the time as an easily readable time in a group, rather than as a numeric 0,1,2,3,4…96 representing which 15 minute time slot of the 24 hours.

The tracking code for recipe video view with timing added for time of day in 15 minute steps could then be coded as (assuming that string type action scope CF 20 is used for timing and function (not listed here) exists called timeofday_in_15minutes() ):

function timeofday_in_15minutes() {
...
code to generate required timing (e.g. '08:00' or '09:15' or '21:45')
...
}

And then tracking code with extra timing information coded in such as:

var timing_info = timeofday_in_15minutes() ;
// sets timing_info to strings such as ’08:45’
YWATracker = YWA.getTracker(“10001234567890123”);
YWATracker.setCF( 17 , "desert");
YWATracker.setCF( 18 , "pie");
YWATracker.setCF( 19 , "apple”);
YWATracker.setCF( 20 , timing_info );
YWATracker.setAction("12");
YWATracker.submit_action();

This type of timing classification using Custom Fields can also be useful for online streaming media analtyics.

In this use usage  we can periodically send tracking beacons to say that streaming media is continuing to be played at regular intervals and store this timing information in an action scope custom field along with an action to denote sub-section has been played. I will be producing a 3rd part to the YWA online video analytics posts that will demonstrate this usage mode (code link here).

Conclusion

I hope in this article we have shown how Custom Fields can be used to avoid falling in the trap of using more and more custom actions to label the conversion events that happen on your site.  Besides using up the limited number of actions available in YWA, it also makes it very hard to create useful reports as each related action would need to listed in the report’s column metric.  Additionally by associating Custom Fields with actions through the use of the ‘action scope’ we are able to add detailed classification and granularity that simplify and enhance the readability of our site’s reports.

How to use Custom fields with actions so we don’t use an excessive number of actions for some user actionable event type.

Instead of using just more and more actions from the limited set of 50 default actions to classify some analytics event, we can use custom fields CFs as well with the actions to help classify and group the particular user action.
Once we choose to have extra Custom Field CF parameters stored along with each occurrence of an action, we then can see more granularity, we can see categories and subcategories of user activity within a type of user action.  When choosing which particular custom fields to use we must be sure to use the correct type of association or scope for the CF. In this example we will want the CFs to be associated with the action, and so we will use ‘Action scope’ so that the CF will be correctly associated with the action.

One Response to “Adding Customization to Actions in YWA”

  1. I think this customization will work fine for the websites with less and static pages.

FOLLOW US
OUR LATEST TWEETS
USEFUL LINKS
POSTS BY SUBJECT
BLOGROLL
YAHOO! BLOGS

We encourage comments and look forward to hearing from you. Please note that Yahoo! may, at our discretion, remove comments if they are off topic, inappropriate, or otherwise violate our Terms of Service.

Our QR Code: