satellite/analytics: track origin header and referer on signup
This allows us to distinguish between accounts created from the signup page vs. from www.storj.io. Also set a field `account_created=true` when we send so that we can see when existing leads have created an account. Change-Id: Ibef34825a08b6c68b8f2869625e576bb837520e5
This commit is contained in:
parent
2a4ff6f469
commit
5351c43757
@ -105,10 +105,13 @@ func (q *HubSpotEvents) EnqueueCreateUser(fields TrackCreateUserFields) {
|
||||
Data: map[string]interface{}{
|
||||
"email": fields.Email,
|
||||
"properties": map[string]interface{}{
|
||||
"email": fields.Email,
|
||||
"firstname": firstName,
|
||||
"lastname": lastName,
|
||||
"lifecyclestage": "customer",
|
||||
"email": fields.Email,
|
||||
"firstname": firstName,
|
||||
"lastname": lastName,
|
||||
"lifecyclestage": "customer",
|
||||
"origin_header": fields.OriginHeader,
|
||||
"signup_referrer": fields.Referrer,
|
||||
"account_created": true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -107,6 +107,8 @@ type TrackCreateUserFields struct {
|
||||
CompanyName string
|
||||
JobTitle string
|
||||
HaveSalesContact bool
|
||||
OriginHeader string
|
||||
Referrer string
|
||||
}
|
||||
|
||||
func (service *Service) enqueueMessage(message segment.Message) {
|
||||
@ -137,6 +139,9 @@ func (service *Service) TrackCreateUser(fields TrackCreateUserFields) {
|
||||
props.Set("name", fields.FullName)
|
||||
props.Set("satellite_selected", service.satelliteName)
|
||||
props.Set("account_type", fields.Type)
|
||||
props.Set("origin_header", fields.OriginHeader)
|
||||
props.Set("signup_referrer", fields.Referrer)
|
||||
props.Set("account_created", true)
|
||||
|
||||
if fields.Type == Professional {
|
||||
props.Set("company_size", fields.EmployeeCount)
|
||||
|
@ -258,12 +258,19 @@ func (a *Auth) Register(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// see if referrer was provided in URL query, otherwise use the Referer header in the request.
|
||||
referrer := r.URL.Query().Get("referrer")
|
||||
if referrer == "" {
|
||||
referrer = r.Referer()
|
||||
}
|
||||
trackCreateUserFields := analytics.TrackCreateUserFields{
|
||||
ID: user.ID,
|
||||
AnonymousID: loadSession(r),
|
||||
FullName: user.FullName,
|
||||
Email: user.Email,
|
||||
Type: analytics.Personal,
|
||||
ID: user.ID,
|
||||
AnonymousID: loadSession(r),
|
||||
FullName: user.FullName,
|
||||
Email: user.Email,
|
||||
Type: analytics.Personal,
|
||||
OriginHeader: origin,
|
||||
Referrer: referrer,
|
||||
}
|
||||
if user.IsProfessional {
|
||||
trackCreateUserFields.Type = analytics.Professional
|
||||
|
Loading…
Reference in New Issue
Block a user