Last active
December 17, 2015 14:39
-
-
Save jfeldstein/5625577 to your computer and use it in GitHub Desktop.
Tracking an event with Segment IO, and displaying a chart of each user's usage stats to that user.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add the following line: | |
//= require ./keentivate/index.js | |
// Before the line: | |
//= require_tree . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="keentivate" | |
data-keen-type="line" | |
data-keen-event="Used Feature X" | |
data-keen-title="Your Usage of Feature X" | |
data-keen-filter="userId=<%= @user.id %>" | |
> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//= require keentivate.min.js | |
//= require initialize.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var keenCharts = new keentivate({ | |
projectId: "50f9e…000000", | |
readKey: "b26ea03…3ed44c" | |
}, | |
{ | |
keenClass: "keentivate" | |
} | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Analytics.track({ | |
:user_id => @user.id, | |
:event => 'Used Feature X', | |
:properties => { | |
:anything_else => "About this event" | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment