Tony Bullard
Tony Bullard

Reputation: 21

Remove personal information from mixpanel javascript tracking call

I'm currently integrating with MixPanel's javascript library and have run into an issue that MixPanel does not seem to have thought about. Our company deals with personally identifiable information(PII), and therefore some data that we pass as params are not appropriate for storage on a third-party service. But MixPanel's default behavior is to include the full url for the current page and the referrer with every tracking event. This makes sense to a degree, but we need to scrub some query parameters out of these fields.

It seems like MixPanel's documentation does not discuss an API for accomplishing this, so any advice from someone more experienced with MixPanel integration would be helpful.

Upvotes: 2

Views: 1140

Answers (2)

Noah Cooper
Noah Cooper

Reputation: 121

You can actually override the Current URL by setting $current_url in your event, e.g.

mixpanel.track('My Event', {
  '$current_url': 'http://www.example.com'
});

Upvotes: 0

TheGreatContini
TheGreatContini

Reputation: 6629

"Our company deals with personally identifiable information(PII), and therefore some data that we pass as params are not appropriate for storage on a third-party service."

You should not be passing sensitive data as URL parameters. This is a security no-no: the values end up in browser history (and thus can be retrieved by somebody looking through the browser history) and in server-side logs. Always pass sensitive data through the HTTP body or headers instead.

References:

Upvotes: 0

Related Questions