Last active
August 29, 2015 14:03
-
-
Save gooley/2e01202c3c6214c66c56 to your computer and use it in GitHub Desktop.
Preact+Segment Client-Side Example
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
// current_user is your logged-in user object | |
// current_account is your account object | |
analytics.identify(current_user.id, { | |
email : current_user.email, | |
name : current_user.name | |
}); | |
analytics.group(current_account.id, { | |
name: current_account.name, | |
license_status: current_account.status, // optional | |
license_mrr: current_account.monthly_rate // optional | |
}); | |
// example with hard-coded values | |
analytics.identify("123", { | |
email : "[email protected]", | |
name : "Christopher Gooley" | |
}); | |
analytics.group("55322", { | |
name: "Preact", | |
license_status: "paying", // optional | |
license_mrr: "499" // optional | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Identify and Group should be called before you call Track on the page.