Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
VE-766: normalize tracking between editors
Browse files Browse the repository at this point in the history
  • Loading branch information
kflorence committed Jan 30, 2014
1 parent 63555f9 commit 3c33a15
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Expand Up @@ -30,6 +30,12 @@
function getTarget() {
var loadTargetDeferred;
if ( !getTargetDeferred ) {
Wikia.Tracker.track( {
'action': Wikia.Tracker.ACTIONS.IMPRESSION,
'category': 'editor-ve',
'label': 'edit-page',
'trackingMethod': 'both'
} );
getTargetDeferred = $.Deferred();
loadTargetDeferred = $.Deferred()
.done( function () {
Expand Down Expand Up @@ -163,8 +169,9 @@

e.preventDefault();

ve.track( 'Edit', { action: 'edit-link-click' } );

getTarget().done( function ( target ) {
ve.track( 'Edit', { action: 'edit-link-click' } );
target.activate();
} );
},
Expand All @@ -176,8 +183,9 @@

e.preventDefault();

ve.track( 'Edit', { action: 'section-edit-link-click' } );

getTarget().done( function ( target ) {
ve.track( 'Edit', { action: 'section-edit-link-click' } );
target.saveEditSection( $( e.target ).closest( 'h1, h2, h3, h4, h5, h6' ).get( 0 ) );
target.activate();
} );
Expand Down
2 changes: 1 addition & 1 deletion extensions/VisualEditor/wikia/modules/ve/ve.track.js
Expand Up @@ -50,7 +50,7 @@ require( ['wikia.tracker'], function ( tracker ) {
'performance.system.activation': function ( data ) {
return {
'action': actions.IMPRESSION,
'label': 'edit-page',
'label': 'edit-page-ready',
'value': data.duration
};
},
Expand Down
4 changes: 2 additions & 2 deletions extensions/wikia/EditPageLayout/js/editor/WikiaEditor.js
Expand Up @@ -265,8 +265,8 @@
GlobalTriggers.fire('WikiaEditorReady', this);
$().log('Editor is ready!', 'WikiaEditor');
WE.track( {
action: Wikia.Tracker.ACTIONS.impression,
label: 'edit-page',
action: Wikia.Tracker.ACTIONS.IMPRESSION,
label: 'edit-page-ready',
value: (new Date() - window.wgNow) / 1000
} );
}
Expand Down
2 changes: 1 addition & 1 deletion extensions/wikia/EditPageLayout/js/plugins/Tracker.js
Expand Up @@ -29,7 +29,7 @@
// Track edit page views and page type
if ( !isMiniEditor ) {
this.track({
action: Wikia.Tracker.ACTIONS.VIEW,
action: Wikia.Tracker.ACTIONS.IMPRESSION,
label: 'edit-page'
});
}
Expand Down

0 comments on commit 3c33a15

Please sign in to comment.