Stripped referrer header on iOS Facebook app

I worked with Jethro recently to diagnose an odd issue we had with Facebook referrers across a couple of publications. One of the breakthroughs came through, as expected, with Facebook referrer mostly intact and our analytics tools picked it up as social referrals. The other came through with a huge chunk of "Direct", when clearly (judging from the campaign code) it wasn't direct. What was going on?

We only worked out the cause by hooking up an Android and iOS device to proxy through Charles on a wireless network and inspecting the traffic as it flowed through.

What we discovered was interesting. Facebook links that bounce through will lose their referrer header on iOS clicks made from the Facebook application. Facebook actually goes to some lengths to pass through referrers without leaking identifiable information (try not to snigger at the line "As part of our continued efforts to protect users’ privacy" from Facebook) but it seems Safari doesn't cooperate when it's redirected through something like

Moral of the story: obviously, always use a campaign code and (for non-GA) remap your sources based on what is in the campaign code. Also, avoid things like if you get a lot of traffic from the Facebook app on iOS.