我有一些Facebook广告和外部广告指向位于页面标签上的应用。
当我的应用存储一些用户信息时,我还想记录哪些广告通过某个标识符将其引荐到应用。
我理解$_SERVER['HTTP_REFERER']
在大多数情况下是不可靠的,并且作为查询字符串(http://www.facebook.com/pages/Test-Page/21814976xxxxxxx?sk=app_25966185xxxxxxx&referrer=advert_1
)传递的任何参数都不会持久存在。
有没有办法可以准确判断用户如何使用我的iframed Facebook应用程序?
在应用上转储所有HTTP请求标头:
[Host] => xxxxx.com.dev
[Connection] => keep-alive
[Content-Length] => 522
[Cache-Control] => max-age=0
[Origin] => http://static.ak.facebook.com
[User-Agent] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1017.2 Safari/535.19
[Content-Type] => application/x-www-form-urlencoded
[Accept] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
[Referer] => http://static.ak.facebook.com/platform/page_proxy.php?v=4
[Accept-Encoding] => gzip,deflate,sdch
[Accept-Language] => en-US,en;q=0.8
[Accept-Charset] => ISO-8859-1,utf-8;q=0.7,*;q=0.3
[Cookie] => PHPSESSID=333dea05c7913f549c98599a797d4f71; __utma=75786053.945637676.1327581224.1327924758.1327928159.8; __utmb=75786053.2.10.1327928159; __utmc=75786053; __utmz=75786053.1327928159.8.8.utmcsr=static.ak.facebook.com|utmccn=(referral)|utmcmd=referral|utmcct=/platform/page_proxy.php; fbsr_259661857422740=N5qiJMZV3Rx_oOpluV9fNfy76R98ux45MF9dqe8SFu4.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiIyLkFRQUU1eWRtcU1wWUlhMkYuMzYwMC4xMzI3OTMyMDAwLjUtMTgxOTA5OTAyMXxZZzNWY3ctdE52YVB1cjJQM3g2OFJBSVlnZEUiLCJpc3N1ZWRfYXQiOjEzMjc5MjgxNzYsInVzZXJfaWQiOiIxODE5MDk5MDIxIn0; ci_session=a%3A6%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%22ac29210xxxxxx8d1896cecdacc669%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A9%3A%22127.0.0.1%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A118%3A%22Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_6_8%29+AppleWebKit%2F535.19+%28KHTML%2C+like+Gecko%29+Chrome%2F18.0.1017.2+Safari%2F535.19%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A1327928158%3Bs%3A9%3A%22user_data%22%3Bs%3A0%3A%22%22%3Bs%3A14%3A%22signed_request%22%3Bs%3A507%3A%22RBHppEnvz_GZwbPA74cZDbFyp3rYr8Tma8yorW3aoUA.eyJ[SNIPPED]%22%3B%7D72d0866c56330f1a75d00d53e44c6aa4
答案 0 :(得分:4)
您可以使用app_data
参数将其他数据传递到Page Tab
此外,如果在您的选项卡加载的URL中的原始查询字符串中设置了
app_data
参数,您的应用程序也会收到一个名为signed_request
的字符串参数作为app_data
的一部分上。对于上面的“立即购买”链接,可能如下所示:“http://www.facebook.com/YourPage?v = app_1234567890& app_data = any_string_here”。如果您控制链接的生成,则可以使用它来自定义您呈现的内容。