forked from jkrall/analytical
-
Notifications
You must be signed in to change notification settings - Fork 0
KissMetrics
gyarra edited this page Feb 1, 2013
·
17 revisions
Here's how to use Analytical with KissMetrics
To configure Kissmetrics, add the following to analytical.yml
production:
kiss_metrics:
js_url_key: '//doug1izaerwt3.cloudfront.net/<your identifier>.js'
Note that entering your key doesn't seem to be required, just your personalized URL to the JS library.
analytical.event('event_name', {'property_name':'value'}) # hash is optional
instead of
_kmq.push(['record', 'event_name', {'property_name':'value'}]);
analytical.set({'property_name':'value'})
instead of
_kmq.push(['set', {'property_name':'value'}]);
Identify takes an optional user_id as the first arg because other libraries use the ID. If you only care about KissMetrics the ID may be omitted.
analytical.identify(current_user.id, :email=>current_user.email) # user_id is optional
analytical.identify(current_user.email)
instead of
_kmq.push(['identify', 'email']);
analytical.alias_identify(first_id, second_id)
instead of
_kmq.push(['alias', 'first_id', 'second_id']);
TrackSubmit isn't part of the Analytical API, however using a server side Analytical record is better than trackSubmit for performance anyway.
analytical.event('event_name', params[:FORM_MODEL_NAME])
instead of
_kmq.push(['trackSubmit', ELEMENT_ID_OR_CLASS, EVENT_NAME]);