Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's a couple of methods to this approach, neither of which are going to get you 100% of what you want.</p> <h2>edge.create</h2> <p>You can listen for <code>edge.create</code> event, through <a href="https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/" rel="nofollow">FB.Event.subscribe</a>. When that's fired, you can remove a <code>display:none</code> attribute from a <code>div</code> or similar element. The downside to that is that your hidden content would still be visible to anyone who viewed the source.</p> <p>The other option on that <code>edge.create</code> event is that you could pull in the content via AJAX, which will keep it out of your source until the event is fired.</p> <p>The problem with the whole <code>edge.create</code> event is that once someone re-visits your page, the <code>edge.create</code> event won't detect that the person already likes your website, so the hidden content won't get displayed.</p> <h2>user_likes</h2> <p>The way around that is to request the <code>user_likes</code> permission. Once you have that, you can call <code>/me/likes/&lt;your_page_id&gt;</code> using the JS-SDK. If we return an empty array, they don't like the page and you wouldn't load the content. If they do, we'll return data on the page, so you'd display it.</p> <p>The problem with that approach is that you'll need to use Facebook Login. Nothing wrong with that in general, but the trade-off is a drop in conversions, which might not be worth it just to hide some content, but that's up to you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload