我有一些 Facebook 广告和外部广告指向位于页面选项卡上的应用。
当我的应用存储一些用户信息时,我还想记录哪个广告通过某些标识符将他们引至应用。
我知道 $_SERVER['HTTP_REFERER']
在大多数情况下是不可靠的,并且任何作为查询字符串传递的参数(http://www.facebook.com/pages/Test -Page/21814976xxxxxxx?sk=app_25966185xxxxxxx&referrer=advert_1
) 不要坚持。
有什么方法可以准确确定用户如何访问我的 iframed Facebook 应用程序?
转储应用程序上的所有 HTTP 请求 header :
[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
最佳答案
您可以使用 app_data
参数将其他数据传递到在 Page Tab 中工作的应用程序
In addition, your application will also receive a string parameter called
app_data
as part ofsigned_request
if anapp_data
parameter was set in the original query string in the URL your tab is loaded on. For the Shop Now link above, that could look like this: "http://www.facebook.com/YourPage?v=app_1234567890&app_data=any_string_here". You can use that to customize the content you render if you control the generation of the link.
关于php - 商店 Facebook 应用引荐来源网址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9064118/