Facebook App Events API: what should be X-Forwarded-For HTTP header for server events?

281 views Asked by At

when sending events to Facebook's App Events API via a server, the X-Forwarded-For http header is expected to be the device's original IP. It makes sense when the server is just a relay for some event that the device wants to sent to Facebook at the moment.

However, in my case, I want my server to send some custom event to Facebook, related to the original device, but it could be the next day or the next week, even if the device is shut down, and definitely regardless of any new IPs it might get in the meantime. So, at the time of the event, all I have is the device's last known IP address - not necessarily the current one. That last known IP might already belong to someone else at this point...

What should I report to Facebook in the X-Forwarded-For http header to keep attribution accurate? Maybe the advertising ID is sufficient in this case and I can skip the header?

Thanks...

1

There are 1 answers

0
elize On BEST ANSWER

Passing right value in X-Forwarded-For HTTP header is highly recommended. Allow me to recommend to send the IP in case the time interval is few hours, but if it is more than a day, for sure a week just don't send X-Forwarded-For HTTP header. Worth mentioning device IP address is really used as fallback to better predict location, in case we failed to do so with other identifiers.