Reputation: 215
I created an API for external applications to log in or make specific web calls using OAuth. What I'm looking for is a way to track the number of times these API calls are being used.
Is there an option for me?
Upvotes: 3
Views: 825
Reputation: 5168
You could send the events with the measurement protocol.
require "net/http"
require "uri"
uri = URI.parse("http://www.google-analytics.com/collect")
Net::HTTP.post_form(uri, {"v" => "1",
"tid" => "UA-XXXX-1",
"cid" => "555",
"t" => "event",
"ec" => "API",
"ea" => "request",
"el" => "data/get",
"ev" => "5"})
Upvotes: 5
Reputation: 11076
I believe you can do this with Google Events:
https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
There are various Ruby libraries for interacting with GA.
Upvotes: -2