What is facebook app id?

Hi, I am trying to host a facebook button as a website with the following code

<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); FB.Event.subscribe('edge.create', function(response) { alert("Thank you for liking my page"); } ); </script> <div class="fb-like-box" data-href="https://www.facebook.com/mypage" data-width="292" data-show-faces="true" data-stream="true" data-show-border="true" data-header="true"></div> 

But the FB.Event function does not work when I tested, I think I can use this trigger event only if I use FB.init and work inside the fbAsyncInit () function. This became known through web search.

I definitely do not know these things. Now the problem is that Fb.init requires appId, channelUrl and a few more. I am confused, I have not created any application, and I am not creating. I'm just trying to put facebook as a button on my website, whereas I can provide an appId.

Can someone explain to me about this appId.Does he had to create as a button and create Fb.event when a user likes my page, how to thank them, or am I using this code incorrectly?

+4
source share
2 answers

It is recommended to use the application identifier for each social plug-in (for example, the Like button).

And here is an overview of how you should implement the SDK for Facebook:

https://developers.facebook.com/docs/javascript/quickstart

It’s better to put this FB.Event code right where it says β€œExtra initialization code ...” - because right now you are using β€œFB” when it’s not even initialized.

And here you can create the application: https://developers.facebook.com/apps

+1
source

Here are some documents about the application id - find fb:app_id on this page: https://developers.facebook.com/docs/sharing/webmasters#markup

You specify the application identifier so that you can use Facebook Domain Insights to view analytics for traffic to your Facebook site. FB Domain Insights is apparently an FB tool that webmasters can use to get information about how the content on their website is shared internally on Facebook.

However, the FB Facebook Domain Insights Facebook page has disappeared ... and instead says you should look for some platforminsights tool. I believe that the FB has recently made some changes to its analysis.

0
source

Source: https://habr.com/ru/post/1484083/


All Articles