0

I simply want to be able to push custom events similar to how you can in the JS API for google analytics, what would be the corresponding GARB code for:

_gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);

This comes from the Events docs for Google Analytics:

https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

GARB is a ruby wrapper for Google Analytics:

https://github.com/vigetlabs/garb

tylerthemiler
  • 5,496
  • 6
  • 32
  • 40
  • Where or what is your problem? What have you tried? – tim.baker Feb 20 '13 at 22:06
  • I want to be able to push Google Analytic events, and I can find zero documentation on how to do it in GARB. I can't try something I can't find code for :P Just want to be able to push events to my GA account via Ruby (Sinatra specifically). – tylerthemiler Feb 20 '13 at 22:08
  • I'm not sure it is possible (without a hack) in GARB to be honest, but that maybe wrong. Could you try passing it to a JS file which could in turn push it to GA? – tim.baker Feb 20 '13 at 22:11

1 Answers1

1

It was a bit hard to find, but there is a really simple Ruby library for handling server-side events for Google Analytics:

https://github.com/hybridgroup/gabba

The equlivant code to the above would be

Gabba::Gabba.new("your-id", "yourdomain.you").event("Videos", "Play")

Hopefully, this question will help others find this useful library faster :P

tylerthemiler
  • 5,496
  • 6
  • 32
  • 40