Skip to content

Commit

Permalink
FFS-2397-3: experimental: use remote_ip instead of ip (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
millerti authored Feb 21, 2025
1 parent 13bdc0a commit 5401497
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/lib/generic_event_tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.for_request(request)
url_params = request.params.slice("client_agency_id", "locale")
defaults = {
# Not setting device_id because Mixpanel fixates on that as the distinct_id, which we do not want
ip: request.ip,
ip: request.remote_ip,
cbv_flow_id: request.session[:cbv_flow_id],
client_agency_id: url_params["client_agency_id"],
locale: url_params["locale"],
Expand Down
2 changes: 1 addition & 1 deletion app/lib/mixpanel_event_tracker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def track(event_type, request, attributes = {})

tracker_attrs = { cbv_flow_id: flow_id }
if request.present?
tracker_attrs.merge!({ ip: request.ip })
tracker_attrs.merge!({ "$ip": request.remote_ip })
end

@tracker.people.set(distinct_id, tracker_attrs)
Expand Down

0 comments on commit 5401497

Please sign in to comment.