Fbp and fbc - how to get this data?

Both the Browser ID and the Click ID are stored in a cookie under your domain (the Browser ID is _fbp and the Click ID is _fbc)…

You can also generate the Click ID using the ‘fbclid’ query parameter in the URL using the format fb.1.timestamp.fbclid (but not all clicks from Facebook have the fbclid parameter, so using the cookie, or a combination of both is probably best)