 <p>This would be very easy with the PHP SDK. A <code>signed_request</code> parameter will get passed on to your iframe, and the PHP SDK offers a function called <code>getSignedRequest()</code> to parse it:</p> <p><a href="https://developers.facebook.com/docs/reference/php/facebook-getSignedRequest/" rel="nofollow">https://developers.facebook.com/docs/reference/php/facebook-getSignedRequest/</a></p> <p>For example:</p> <pre><code>$sr = $fb-&gt;getSignedRequest(); echo $sr['page']['id']; </code></pre> <p>With JavaScript it would be a lot more complicated. You could try to get the signed_request parameter like this: <a href="http://stackoverflow.com/questions/5448545/how-to-retrieve-get-parameters-from-javascript">How to retrieve GET parameters from javascript?</a> - But you would have to deal with the parameter on your own. Here´s how to parse the parameter on your own with PHP: <a href="https://developers.facebook.com/docs/facebook-login/using-login-with-games" rel="nofollow">https://developers.facebook.com/docs/facebook-login/using-login-with-games</a></p> <p>No Facebook SDK needed in that case, btw. And it should also work with PHP &lt;5.4.</p>