File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ var ScratchIt = module.exports = integration('Scratch-it Analytics')
24
24
ScratchIt . prototype . initialize = function ( ) {
25
25
var self = this ;
26
26
27
- this . load ( function ( ) {
28
- if ( ! window . ScratchItAnalytics ) {
27
+ this . load ( function ( ) {
28
+ if ( ! window . ScratchItAnalytics ) {
29
29
return null ;
30
30
}
31
31
@@ -44,10 +44,12 @@ ScratchIt.prototype.loaded = function() {
44
44
} ;
45
45
46
46
/**
47
- * Track.
47
+ * Track an event .
48
48
*
49
+ * @api public
49
50
* @param {Track } track
50
51
*/
52
+
51
53
ScratchIt . prototype . track = function ( track ) {
52
54
var parameters = track . properties ( ) ;
53
55
var event_type = parameters . event_type || 'track' ;
@@ -58,10 +60,12 @@ ScratchIt.prototype.track = function(track) {
58
60
/**
59
61
* Page.
60
62
*
63
+ * @api public
61
64
* @param {Page } page
62
65
*/
66
+
63
67
ScratchIt . prototype . page = function ( page ) {
64
68
var customProperties = page . properties ( ) ;
65
69
del ( customProperties , 'event_type' ) ;
66
- window . _ScratchIt . track ( 'page_visit ' , 'page_visit' , customProperties ) ;
70
+ window . _ScratchIt . track ( 'track ' , 'page_visit' , customProperties ) ;
67
71
} ;
Original file line number Diff line number Diff line change @@ -91,14 +91,14 @@ describe('ScratchIt', function() {
91
91
} ) ;
92
92
} ) ;
93
93
94
- describe ( '#page' , function ( ) {
94
+ describe ( '#page' , function ( ) {
95
95
beforeEach ( function ( ) {
96
96
analytics . stub ( window . _ScratchIt , 'track' ) ;
97
97
} ) ;
98
98
99
99
it ( 'should send a page tracking event' , function ( ) {
100
100
analytics . page ( ) ;
101
- analytics . called ( window . _ScratchIt . track , 'page_visit ' , 'page_visit' ) ;
101
+ analytics . called ( window . _ScratchIt . track , 'track ' , 'page_visit' ) ;
102
102
} ) ;
103
103
} ) ;
104
104
} ) ;
You can’t perform that action at this time.
0 commit comments