Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.

feat: migrate from mixpanel to segment#1005

Merged
itegulov merged 3 commits into
masterfrom
daniyar/mixpanel-to-segment
Aug 4, 2022
Merged

feat: migrate from mixpanel to segment#1005
itegulov merged 3 commits into
masterfrom
daniyar/mixpanel-to-segment

Conversation

@itegulov

Copy link
Copy Markdown
Contributor

No description provided.

@itegulov itegulov requested review from TiffanyGYJ and volovyks July 22, 2022 12:16
Comment thread utils/eventtracking.js Outdated
Comment thread utils/eventtracking.js Outdated
const id = getMixpanelID(shellSettings);
await mixpanel.people.increment(id, 'deployed_contracts');
const id = getSegmentID(shellSettings);
// TODO: find a way to increment a Segment analytic property

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like there is no persistent analytic properties in segment (or at least a direct replacement). Not sure how much we care about the total amount of deployed contracts as a stored number vs aggregating them by deployed events.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@volovyks volovyks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great that the API is so similar!

Comment thread utils/eventtracking.js
}

if (shouldTrackID(shellSettings)) {
if (options.accountId && shouldTrackID(shellSettings)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itegulov is this change intended?
I think users can avoid tracking even if they do not pass any accountId in command.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, previousId is a non-optional field in Segment, so it was throwing runtime errors without this check

Comment thread utils/eventtracking.js Outdated
const id = getMixpanelID(shellSettings);
await mixpanel.people.increment(id, 'deployed_contracts');
const id = getSegmentID(shellSettings);
// TODO: find a way to increment a Segment analytic property

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itegulov are you planning to work on it now?
Deployed contracts are the most important part of analytics IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have spent some time looking for alternatives to no avail, so I think it would make sense to hear @TiffanyGYJ's opinion first before spending even more time on this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployed contracts are the most important part of analytics IMO.

Curious to hear your reasoning. Wouldn't aggregating deployed events achieve the same goal? Do we need to store/cache this as a definite number for something?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deployed events might happen multiple times with different contracts, so that might not be an accurate estimate on how many unique contracts each dev deployed.
Is there a way we can track that somewhere else or finding a way from Segment/Mixpanel is the best option?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TiffanyGYJ

Deployed events might happen multiple times with different contracts, so that might not be an accurate estimate on how many unique contracts each dev deployed.

Looking through the code, the current logic does not track unique deployed contracts either, just the number of times when devDeploy/deploy were executed successfully.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the total number of deploys per week is the most important metric since we are tracking developer activity.
The number of active contracts (contracts that have been deployed or redeployed in the past week) is also important.
Tracking a particular user and his deploys is not that important IMO, and a bit shady.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that the total number of deploys per week is the most important metric since we are tracking developer activity. The number of active contracts (contracts that have been deployed or redeployed in the past week) is also important.

I agree with this, but a per-user counter does not really help with that, no? Increments do not have a timestamp, so you would have to track how much a counter has changed each week which kind of beats its point. I think we can deduce all that information just from tracking events (by writing a small custom event consumer or building something in Segment itself, not sure if it provides any processing logic).

Tracking a particular user and his deploys is not that important IMO, and a bit shady.

👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree!

@itegulov

itegulov commented Aug 2, 2022

Copy link
Copy Markdown
Contributor Author

I have deleted the deployed contract tracking, so I think this PR is ready for a review

CC @volovyk-s @TiffanyGYJ

@itegulov itegulov merged commit 44540c7 into master Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants