Search code examples
facebookfacebook-graph-apifacebook-php-sdkfacebook-ads-apifacebook-ads

User data in event for Facebook server to server


I plan to generate Facebook events (Conversion API) on server side when the user completes registration process. These events will be used for advertising my solution in Facebook and tuning target audience on registration events.

I use POST request to https://graph.facebook.com/v9.0/289777498957502/events to send events. I have to pass user_data entity inside a body of this request. This user data can be email address, click id, user IP address or something else.
I don't have any of these on server side but I can get it.

The problem is that I don't understand why Facebook needs user data and what exactly it needs as data. I can send everything to Facebook but I need to understand mandatory information it requires.
Do you know what should be sent as user data?

As an option I can send internal ID in my system of each user inside user data but I'm not sure Facebook will be happy with that.

Facebook manuals are a pure joke. Literally all are outdated and no information on user data content and why it's required.


Solution

  • The problem is that I don't understand why Facebook needs user data

    Because your conversion is (ideally) supposed to get connected to an actual user account. Facebook knows, who the user is, as long as we are on the client side, and their pixel is embedded somewhere - they can make the cross-domain requests in the background, to see who is currently logged-in to Facebook on the device. But if you send conversion data later, from your server - how would they be supposed to associate that with a specific user then, if you don’t send them any data that could identify one?

    and what exactly it needs as data.

    If you have anything that can uniquely identify the Facebook user, then send that. Otherwise, send as much data as you can – to increase the posibility, that Facebook will be able to match this to a specific individual.

    Check the list they provide under https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/customer-information-parameters

    If the user is logged in to your Facebook app while they are on your site, then send the fb_login_id – that is as unique and specific, as can be.

    If you don’t use Facebook login on your site, or the user can also perform the action in question without being logged into your Facebook app - then send whatever you have, that identifies them on your end.

    In case no unique match is possible, then send as much as possible - first & last name, phone number, date of birth - all those help to narrow down who the user might be on Facebook’s side.

    The same data, or at least as much of it as is available at this time, should also be send with the pixel tracking code on the client side already. https://developers.facebook.com/docs/facebook-pixel/advanced/advanced-matching/ has details on that.