Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add test for event tracking, adapt tests to errback

  • Loading branch information...
commit 653340cc1430d28b3ddca067df0d92aca02b3c1e 1 parent 6f034b0
@hannesgassert hannesgassert authored
Showing with 20 additions and 3 deletions.
  1. +20 −3 tests/t.js
View
23 tests/t.js
@@ -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');
+ }
+);
Please sign in to comment.
Something went wrong with that request. Please try again.