Knowledge Base > Syndication Services > Editor's Desk and Widgets
Search the Knowledge Base
 
Date Modified
Thursday, April 24, 2008
Keeping track of user interaction in your widgets

There are two basic types of tracking in widgets: post (article) attention data and everything else. The first is logged when a user clicks on an article title and taken to the source content. For everything else, the following table outlines some typical user interactions with widgets. It also lists suggested tracking type parameters, which keep track of what sort of interaction occurred. However, for the time being they will all show up in reporting for a widget as "other interaction."

User Interaction
Tracking Type
Suggested Parameter
Checking/Unchecking a checkbox
Exploration
Custom2
Selecting a tab
Navigation
Custom1
Expanding/Collapsing a widget section
Exploration
Custom2
Clicking next or previous in paging widget
Navigation
Custom1
Interacting with an accordion widget
Navigation
Custom1
Clicking on content to flyout
Exploration
Custom2
Changing number of articles to display
Exploration
Custom2
Using a search function
Click-Through
Playing a podcast
Navigation
Custom1
Clicking on an ad
Click-Through


To log any event, simply add the following code to either the HTML template or the JavaScript. There is no difference in where the tracking code is placed, the events will be logged just the same:

1. Logging events from the HTML template.

The HTML tracking should be done within an event handler attribute, such as onclick.

a) AttentionClickJS(post) - Logs a click event, so on the reporting page of a widget it will appear as a "Click Through." This is most commonly used for when a user clicks on an article title which directs them to the source content's website, but it can be used for other interactions if necessary. The "post" parameter is optional.

    Example: <a href="${Post.HtmlUrl|html}" onclick="$AttentionClickJS(Post)}">${Post.Title|default:"(no title)"}</a>

b) AttentionJS(action, post) - This will log any event that you specify. Including the "custom" parameter will help differentiate click events.
  action - The type of event, which at this time will usually be "custom1," "custom2," etc.
  post - The individual post you would like to assign this action to (optional).

    Example: <a href="javascript:void(0)" onclick="GoToNextPage(); ${AttentionJS("custom1")}">Next page</a>
    Example: <a href="javascript:void(0)" onclick="${AttentionJS("custom2", Post)}">${Post.Title|default:"(no title)</a>

2. Logging events from JavaScript.

Attention tracking can also be defined within the JavaScript of a widget, such as within functions that are called by multiple events from the HTML.

a) logPostEvent(action, postId, feedId, link, evt, node) - Logs an event against a particular post.

    Example: ng_buzzObj.logPostEvent("custom1", Post.PostId, Post.FeedId, Post.HtmlUrl);

b) logGenericEvent(action, evt, node) - Logs any click event specified.
  action - The type of event, which at this time will usually be "custom1," "custom2," etc.
  evt - Optional, the name of the JavaScript event that caused the action, such as "onclick."
  node - Optional, the DOM node that was clicked or interacted with.

    Example: ng_buzzObj.logGenericEvent("custom1");
These events utilize the buzz object, which, when not declared explicitly somewhere in the JavaScript, can be accessed by the following built-in:
${BuzzObjJS}.logGenericEvent("Custom1");


If you have additional questions, or need personalized help on this topic, please send an email to Private Label Support.


Knowledge Base Software - myKB.com