class GAMeasurements

Constants

API_ENDPOINT
API_VERSION
TYPES

Attributes

client_id[RW]
property_id[RW]

Public Class Methods

new(property_id, client_id = UUID.new.generate) click to toggle source
# File lib/ga-measurements.rb, line 13
def initialize(property_id, client_id = UUID.new.generate)
  @property_id, @client_id = property_id, client_id
end

Public Instance Methods

Private Instance Methods

post(type, params) click to toggle source
# File lib/ga-measurements.rb, line 28
def post(type, params)
  payload = params.merge({t: type, tid: property_id, cid: client_id, v: API_VERSION})

  response = self.class.post(API_ENDPOINT, { body: payload })

  return response.code
end