Tracking Custom User Metadata
You can send any custom user metadata to build detailed audience segments.
Custom user metadata can be sent for both incoming and outgoing messages.
Examples of metadata that you might send:
- Your own User ID
- Experiment Group, for A/B Testing
- Favorite Book
- Location
Incoming Messages
Define and add custom user parameters inside the message field.
{"object": "page","entry": [{"id": "1761187137541529","time": 1529364165626,"messaging": [{"sender": {"id": "967295313370594"},"recipient": {"id": "1761187137541529"},"timestamp": 1529364165301,"message": {"mid": "mid.$cAAZBymTGuo5qRnp6tVkFTUyjOOfm","seq": 20809,"text": "add user info"},"platformUserJson": {"favoriteBook": "Harry Potter and the Goblet of Fire","ABTestGroup": "A"}}]}]}
Outgoing Messages
{"url": "https://graph.facebook.com/v2.6/me/messages","qs": {"access_token": "EAADUlFUZBhlMBAOD5EUf8YErqZBppwsrblZAfWZA3N9ATYlh7fVKLHimoHcbT1KUyHrBGDtknTxmNP65ZCXc9pkjTxnZAWwZBWB4WxFKtiDR2u7LLrdrHU39Y2SB6VJAHpv2130skUpV0MXCAp4VJaI40DgBc59E2c3zsSTE0O4dAZDZD"},"method": "POST","json": {"recipient": {"id": "967295313370594"},"message": {"text": "You are right when say: add user info"}},"platformUserJson": {"favoriteBook": "Harry Potter and the Goblet of Fire","ABTestGroup": "A"},"responseBody": {"recipient_id": "967295313370594","message_id": "mid.$cAAZBymTGuo5qRnp-nFkFTU2Blcaf"}}