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

Commit

Permalink
Merge pull request #5 from sailxjx/master
Browse files Browse the repository at this point in the history
fix initial bug
  • Loading branch information
sailxjx committed Aug 22, 2013
2 parents 87dcbf4 + df358ce commit 8fe8ea5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Cakefile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
require('cake-dog')
require("cake-dog")

13 changes: 7 additions & 6 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Gta
constructor: (option) ->
@option = option
@option.account = option.account or ''
@_initial()

class @Google extends @Base

Expand All @@ -63,11 +64,11 @@ class Gta
pageview: ->
args = (val for i, val of arguments)
data = if typeof args[0] == 'object' then args[0] else args.join('_')
window.ga('send', 'pageview', data)
window.ga?('send', 'pageview', data)

event: ->
args = (val for i, val of arguments)
window.ga('send', 'events', args)
window.ga?('send', 'events', args)

class @Baidu extends @Base

Expand Down Expand Up @@ -98,11 +99,11 @@ class Gta
data = data.join('_')
else
data = args.join('_')
window._hmt.push(['_trackPageview', data])
window._hmt?.push(['_trackPageview', data])

event: ->
args = (val for i, val of arguments)
data = ['_trackEvent'].concat(args)
window._htm.push(data)
window._hmt?.push(data)

exports.Gta = Gta

0 comments on commit 8fe8ea5

Please sign in to comment.