Using Virtual Page Views to strip URL parameters from FB Pixel data

Viewed 509

With Facebooks recent updates flagging potential personally identifiable data being collected by the FB Pixel, we've ended up getting flagged for having latitude and longitude in our URL parameters on our search result pages (which is a geographic search based on a submitted address). This data does not match user locations, but FB obviously don't care about nuances.

From what I can tell, data from sessions that include URLs with lat/lng in the parameters, are excluded from the data used for targeting our ads, which has significantly affect performance. To rectify this I'd like to strip URL parameters from the URLs being collected by FB.

One suggestion given to me is to edit the FB pixel code and replace fbq('track', 'PageView'); with a Virtual Page View. Would this work? Will a Virtual Page View prevent URL parameters being passed? Or is there more to it than that?

1 Answers

So we tested this out, replacing fbq('track', 'PageView'); with fbq('trackCustom', 'VirtualPageView', {url: fbpixelUrlWithoutLatLng()}); (with a function to strip out lat/lng from the URL).

While this call works exactly as intended, Facebook is still receiving the full URL (I suspect they ingest the URL from HTTP headers in addition to any page view events triggered).

I'm not really sure that there's any other viable solutions to this without having to re-engineer/re-implement the URLs (either passing the parameters in another way, or obfuscating them).

Related