Skip to content
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

Ensure that teamId and orgId are populated on most page load events #1177

Closed
jordanh opened this issue Jul 28, 2017 · 6 comments
Closed

Ensure that teamId and orgId are populated on most page load events #1177

jordanh opened this issue Jul 28, 2017 · 6 comments
Assignees
Labels

Comments

@jordanh
Copy link
Contributor

jordanh commented Jul 28, 2017

Issue - Bug

After auditing the segment events this morning, I see that teamId is on most page events (if its available from the url). orgId is only sent if somebody accesses /me/organizations/:orgId. Looking at the code, this is how we've designed it.

I'd like to change this, like so:

  • When a teamId is extracted from the url, also look up the orgId and send it along with the page load event

...this will make our weekly active org's metric meaningful.

@mattkrick
Copy link
Member

an alternative:

  • instead of sending events straight from the client, send them to our server first, then send them to segment. that way we can populate all the info we want (including team name, org name, person's name, etc.) and we avoid adblockers, so our data capture rate is 100% instead of just a sample. probably not necessary for page change events, but for the big events, we'll wanna capture as many of those as we can & make sure they contain all the metadata they can.

@jordanh
Copy link
Contributor Author

jordanh commented Jul 28, 2017

True dat. I like this approach. Design a little pageEvent mutation?

@mattkrick
Copy link
Member

yeah, that'd be really clean. The only downside is that a mutation will want a response from the server. so our options are:

  • treat it as a mutation, receive a boolean payload from the server & just ignore it
  • set up a segment endpoint & call that. internally, it could still use graphql, but then we dont need to reply.
  • tell our network layer to sniff for pageEvent and if it gets it, resolves the promise with a bool. then, send it off. on the server, sniff for pageEvent & don't reply if found.

@ackernaut
Copy link
Member

I like what I’m seeing here!

@mattkrick mattkrick self-assigned this Aug 16, 2017
@mattkrick
Copy link
Member

hey @jordanh
what's the shape of the object you wanna send to segment?
most of the time, teamId is a peer to userId.
For endMeeting though, it's a peer but also lives under properties:
https://github.com/ParabolInc/action/blob/master/src/server/graphql/models/Team/endMeeting/endMeeting.js#L108-L117

Is this required? I feel like we only need it once, but if we need it twice here, I'd like to put it in both places everywhere.

Also, same question with orgId.

@mattkrick
Copy link
Member

hey @jordanh i see we're tracking stripe errors with segment. why use segment over sentry? feels like we should be calling raven instead of segment...

mattkrick added a commit that referenced this issue Aug 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants