cabennett85/gittest — Issue #688: Instrument BroadCause with click tracking
Author: cabennett85
Created: 2012-03-02 00:08:45+00:00
State: open

There are two categories of metrics:

1. metrics that use MetricsCounter that we leave running forever.

2. metrics that use MetricsTracker or SplitTest that track users in a DB, which means we can't leave it running forever due to performance reasons.

There will likely be code reuse between 1 and 2. For example, if we want click tracking using MetricsCounter, but then we want to also track clicks segmented by which page the user's landing page, we can then use MetricsTracker but use the same CTNode tree in javascript.

Let's have some click tracking. Here's a rough skeleton of what we'll track. We might add/modify things as the actual pages change.

{{{
ClickTracker.BROADCAUSE_PAGE_TREE = CTNode('broadcause', '*', [
'site-header', '#broadcause-header', [
CTNode('homepage', ''),
CTNode('for-brands', ''),
CTNode('for-causes', '')
]),
'site-footer', '#footer', [

])
])
ClickTracker.BROADCAUSE_SITE_TREE = CTNode('*', '*' [
CTNode('for-brands', '.broadcause.for-brands', [
ClickTracker.BROADCAUSE_PAGE_TREE
]),
CTNode('for-causes', '.broadcause.for-causes', [
ClickTracker.BROADCAUSE_PAGE_TREE
]),
CTNode('register', '.broadcause.registration-page', [
ClickTracker.BROADCAUSE_PAGE_TREE
]),
CTNode('register', '.broadcause.cause-profile', [
CTNode('share-buttons', '.social-share', [
CTNode('fb-share', '')
// can't track the tweet and stumbleupon since they are in iframes
]),
CTNode('external-links', '.platforms', [
CTNode('cause-website', '.homepage-link'),
CTNode('facebook', '.fb-link'),
CTNode('twitter', '.twitter-link')
]),
CTNode('video', '.video'),
ClickTracker.BROADCAUSE_PAGE_TREE
]),
CTNode('login', '.broadcause.cause-login', [
CTNode('forgot-password', ''),
ClickTracker.BROADCAUSE_PAGE_TREE
])
]);
}}}