-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Posthog analytics #1293
Posthog analytics #1293
Conversation
set up groups for schools identify users on key pages refactor more educator events update user vars always profile handle current_user being nil remove log another null remove event profile students use school id no event required on signup done fix user call update identify remove student verify identify call add uuid to person refactor posthog init config revert identified only users consolidate ident template calls resume error handling fix profile
67a14c6
to
5015476
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, looks OK to me. I feel like maybe the security log calls could be combined with this, but not sure.
@@ -18,7 +18,6 @@ def login | |||
success: lambda { | |||
clear_signup_state | |||
user = @handler_result.outputs.user | |||
Sentry.set_user(id: user.id) if Rails.env.production? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this because nothing here throws? Or some other reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -63,7 +66,7 @@ def oauth_callback | |||
sign_up: view_context.link_to(I18n.t(:"login_signup_form.sign_up"), newflow_signup_path) | |||
) | |||
) | |||
when :authentication_taken || :taken | |||
when :authentication_taken || 'taken' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems odd that one would be a string and the other a symbol?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing this, because it's still failing, but the error code is definitely 'taken', so hoping a string will cover the error code
<%= javascript_include_tag "application" %> | ||
<%= csrf_meta_tags %> | ||
|
||
<%= yield :head if content_for?(:head) %> | ||
|
||
<% if !Rails.env.test? %> | ||
<script src="https://cdn.optimizely.com/js/1345615444.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should we remove this if we find it in other apps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YES - we haven't used optimizely in a very long time
@@ -119,6 +119,8 @@ development: | |||
sentry: | |||
dsn: <%= ENV['SENTRY_DSN'] || 'invalid' %> | |||
|
|||
posthog_project_api_key: <%= ENV['POSTHOG_PROJECT_API_KEY'] || 'phc_n9UdrQ7MA5hF21CqmbGWoSxM1LfzxpcCxcjUBGfcdrE' %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, just make sure this key is not valid for anything, as this repo is public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the test key (and is available in the javascript, anyway); there is a separate production key in the parameter store
they key is write only, so it being a test key is okay in this instance (subject to change if someone starts hammering our posthog instance of course) - this just makes it easier to change
To infer more usage without having to ask users (less reliance on self-reported adoption), we want to try Posthog. This product integrates with Salesforce and S3 (event capture), allowing us to create a CDP that can ingest and map information across multiple systems.
This could also grow into a better replacement of Google Analytics. I've been talking with the team, and they offer non-profit discounts, though the free tier will likely be plenty for Accounts + a few other marketing-based forms, pages, and the help center (where it is already installed).
The privacy policy is in alignment with our org goals, and their documentation and open-source code is an outstanding added perk (we could self-host this, but I don't think we have the resources in-house for managing that).
The built-in survey platform looks promising in replacing the very expensive PulseInsights.
This PR adds the ruby library to capture key events on server-side actions. It also contains the Javascript snippet to capture page enter/exit. Both of these identify the user, allowing us to join on tables in other systems for analysis on behavior.
Future todos: