Permalink
Browse files

Add test for event tracking, adapt tests to errback

  • Loading branch information...
1 parent 6f034b0 commit 653340cc1430d28b3ddca067df0d92aca02b3c1e @hannesgassert hannesgassert committed Oct 7, 2012
Showing with 20 additions and 3 deletions.
  1. +20 −3 tests/t.js
View
@@ -1,8 +1,25 @@
var GoogleAnalytics = require('../lib/ga');
-var testUA = "UA-25564582-1";
+var testUA = 'UA-25564582-1';
var testHost = 'nodega.jga.me';
+
var ga = new GoogleAnalytics(testUA, testHost);
+
ga.debug = true;
-ga.trackPage('test/1', 1, function() {
- console.log('done');
+
+ga.trackPage('test/1', 1, function(err) {
+ console.log(err || 'Page tracked');
});
+
+ga.trackEvent(
+ {
+ category: 'Videos',
+ action: 'Video Loading',
+ label: 'Gone With the Wind',
+ value: 3,
+ nonInteraction: true
+ },
+ 2,
+ function(err) {
+ console.log(err || 'Event tracked');
+ }
+);

0 comments on commit 653340c

Please sign in to comment.