satellite/analytics: stop sending normal account activity events directly to Hubspot
Removed code which was responsible for tracking regular user activity in hubspot. The only direct event we send to Hubspot is 'user created'. Issue: https://github.com/storj/storj-private/issues/441 Change-Id: Ia6da30374f91369372af8fe5b5990ec5672fc03b
This commit is contained in:
parent
5295afb2da
commit
25ffa3ad11
@ -203,27 +203,6 @@ func (q *HubSpotEvents) EnqueueCreateUser(fields TrackCreateUserFields) {
|
||||
}
|
||||
}
|
||||
|
||||
// EnqueueEvent for sending user behavioral event to HubSpot.
|
||||
func (q *HubSpotEvents) EnqueueEvent(email, eventName string, properties map[string]interface{}) {
|
||||
eventName = strings.ReplaceAll(eventName, " ", "_")
|
||||
eventName = strings.ToLower(eventName)
|
||||
eventName = eventPrefix + "_" + eventName
|
||||
|
||||
newEvent := HubSpotEvent{
|
||||
Endpoint: "https://api.hubapi.com/events/v3/send",
|
||||
Data: map[string]interface{}{
|
||||
"email": email,
|
||||
"eventName": eventName,
|
||||
"properties": properties,
|
||||
},
|
||||
}
|
||||
select {
|
||||
case q.events <- []HubSpotEvent{newEvent}:
|
||||
default:
|
||||
q.log.Error("sending hubspot event failed, event channel is full")
|
||||
}
|
||||
}
|
||||
|
||||
// handleSingleEvent for handle the single HubSpot API request.
|
||||
func (q *HubSpotEvents) handleSingleEvent(ctx context.Context, ev HubSpotEvent) (err error) {
|
||||
payloadBytes, err := json.Marshal(ev.Data)
|
||||
|
@ -321,10 +321,6 @@ func (service *Service) TrackSignedIn(userID uuid.UUID, email string) {
|
||||
Event: service.satelliteName + " " + eventSignedIn,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
service.hubspot.EnqueueEvent(email, service.satelliteName+"_"+eventSignedIn, map[string]interface{}{
|
||||
"userid": userID.String(),
|
||||
})
|
||||
}
|
||||
|
||||
// TrackProjectCreated sends an "Project Created" event to Segment.
|
||||
@ -343,12 +339,6 @@ func (service *Service) TrackProjectCreated(userID uuid.UUID, email string, proj
|
||||
Event: service.satelliteName + " " + eventProjectCreated,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
service.hubspot.EnqueueEvent(email, service.satelliteName+"_"+eventProjectCreated, map[string]interface{}{
|
||||
"userid": userID.String(),
|
||||
"project_count": currentProjectCount,
|
||||
"project_id": projectID.String(),
|
||||
})
|
||||
}
|
||||
|
||||
// TrackAccountFrozen sends an account frozen event to Segment.
|
||||
@ -484,10 +474,6 @@ func (service *Service) TrackAccessGrantCreated(userID uuid.UUID, email string)
|
||||
Event: service.satelliteName + " " + eventAccessGrantCreated,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
service.hubspot.EnqueueEvent(email, service.satelliteName+"_"+eventAccessGrantCreated, map[string]interface{}{
|
||||
"userid": userID.String(),
|
||||
})
|
||||
}
|
||||
|
||||
// TrackAccountVerified sends an "Account Verified" event to Segment.
|
||||
@ -512,10 +498,6 @@ func (service *Service) TrackAccountVerified(userID uuid.UUID, email string) {
|
||||
Event: service.satelliteName + " " + eventAccountVerified,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
service.hubspot.EnqueueEvent(email, service.satelliteName+"_"+eventAccountVerified, map[string]interface{}{
|
||||
"userid": userID.String(),
|
||||
})
|
||||
}
|
||||
|
||||
// TrackEvent sends an arbitrary event associated with user ID to Segment.
|
||||
@ -543,10 +525,6 @@ func (service *Service) TrackEvent(eventName string, userID uuid.UUID, email str
|
||||
Event: service.satelliteName + " " + eventName,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
service.hubspot.EnqueueEvent(email, service.satelliteName+"_"+eventName, map[string]interface{}{
|
||||
"userid": userID.String(),
|
||||
})
|
||||
}
|
||||
|
||||
// TrackErrorEvent sends an arbitrary error event associated with user ID to Segment.
|
||||
@ -589,11 +567,6 @@ func (service *Service) TrackLinkEvent(eventName string, userID uuid.UUID, email
|
||||
Event: service.satelliteName + " " + eventName,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
service.hubspot.EnqueueEvent(email, service.satelliteName+"_"+eventName, map[string]interface{}{
|
||||
"userid": userID.String(),
|
||||
"link": link,
|
||||
})
|
||||
}
|
||||
|
||||
// TrackCreditCardAdded sends an "Credit Card Added" event to Segment.
|
||||
@ -610,7 +583,6 @@ func (service *Service) TrackCreditCardAdded(userID uuid.UUID, email string) {
|
||||
Event: service.satelliteName + " " + eventCreditCardAdded,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// PageVisitEvent sends a page visit event associated with user ID to Segment.
|
||||
@ -631,7 +603,6 @@ func (service *Service) PageVisitEvent(pageName string, userID uuid.UUID, email
|
||||
Name: "Page Requested",
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// TrackProjectLimitError sends an "Project Limit Error" event to Segment.
|
||||
@ -648,7 +619,6 @@ func (service *Service) TrackProjectLimitError(userID uuid.UUID, email string) {
|
||||
Event: service.satelliteName + " " + eventProjectLimitError,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// TrackStorjTokenAdded sends an "Storj Token Added" event to Segment.
|
||||
@ -665,7 +635,6 @@ func (service *Service) TrackStorjTokenAdded(userID uuid.UUID, email string) {
|
||||
Event: service.satelliteName + " " + eventStorjTokenAdded,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// TrackProjectMemberAddition sends an "Project Member Added" event to Segment.
|
||||
@ -682,7 +651,6 @@ func (service *Service) TrackProjectMemberAddition(userID uuid.UUID, email strin
|
||||
Event: service.satelliteName + " " + eventProjectMemberAdded,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// TrackProjectMemberDeletion sends an "Project Member Deleted" event to Segment.
|
||||
@ -699,7 +667,6 @@ func (service *Service) TrackProjectMemberDeletion(userID uuid.UUID, email strin
|
||||
Event: service.satelliteName + " " + eventProjectMemberDeleted,
|
||||
Properties: props,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
// TrackExpiredCreditNeedsRemoval sends an "Expired Credit Needs Removal" event to Segment.
|
||||
|
Loading…
Reference in New Issue
Block a user