-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make GA integration work with named trackers
allow configuring ga tracker name and add some tests add ga spec coding style updates update prefixedSend usage use trackerSend instead of prefixedSend fix tests fix trackerSend undefined error - @protonate
- Loading branch information
Showing
2 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var assert = require('assert'); | ||
var ga = require('../../src/ga'); | ||
|
||
describe('Ga', function () { | ||
|
||
describe('enableAnalytics', function () { | ||
|
||
it('should accept a tracker name option and output prefixed send string', function () { | ||
var options = { trackerName: 'foo' }; | ||
ga.enableAnalytics(options); | ||
|
||
var output = ga.getTrackerSend(); | ||
assert.equal(output, 'foo.send'); | ||
}); | ||
|
||
|
||
it('should output normal send string when trackerName is not set', function () { | ||
var options = {}; | ||
ga.enableAnalytics(options); | ||
|
||
var output = ga.getTrackerSend(); | ||
assert.equal(output, 'send'); | ||
}); | ||
|
||
}); | ||
|
||
|
||
}); |