为什么我的 Facebook Like 按钮会创建一个全新的 Facebook 页面?

发布于 2024-09-14 01:10:51 字数 1644 浏览 2 评论 0原文

我正在尝试将 Facebook 集成到我正在开发的网站中,我已经为该业务创建了一个 Facebook 页面也是 Facebook 应用程序 - 我对文档和应用程序感到非常困惑Facebook 使用的术语。

我正在使用 FBML 在我的网站页脚添加一个“推荐”按钮,以便用户可以推荐该特定页面,但是当我单击它时,它会为该 URI 和该页面创建一个全新的 Facebook 页面。似乎忽略了所有的 facebook &打开图形元标记信息。

仅供参考,这些是我正在使用的元标记:

<meta property="og:title" content="My Page title"/>
<meta property="og:type" content="company"/>
<meta property="og:url" content="http://mysite.com/"/>
<meta property="og:image" content="http://mysiteimage.jpg"/>
<meta property="og:site_name" content="My Site Name"/>
<meta property="fb:admins" content="My_FB_Admin_ID"/>
<meta property="fb:page_id" content="My_FB_Page_ID" />
<meta property="fb:app_id" content="My_FB_App_ID" />
<meta property="og:description" content="Desctiption of page"/>

这是我正在使用的 FBML:

<fb:like width="940" action="recommend" font="lucida grande"></fb:like>

这是我在 标记之前添加到每个页面的 Facebook Javascript SDK 代码(每页仅添加一次):

<div id="fb-root"></div>
<script>
    window.fbAsyncInit = function() {
        FB.init({appId: 'My_FB_App_ID', status: true, cookie: true,
        xfbml: true});
    };
    (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
        '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
    }());
</script>

有人知道我到底应该做什么吗?我应该使用应用程序作为粉丝页面还是我已经使用的页面?

我也非常希望能够“喜欢/推荐”网站上的实际 Facebook 页面,这可能吗?

非常感谢。

梭鲈

I'm trying to integrate Facebook into a site I'm developing, I have created a Facebook Page for the business & a Facebook app too - I am very confused with the documentation & terminology that Facebook uses.

I am using FBML to add a Recommend button to the footer of my site so that users can recommend that particular page but when I click on it, it creates a brand new Facebook page for that URI & seemingly ignores all the facebook & open graph metatag info.

FYI, these are the metatags that I'm using:

<meta property="og:title" content="My Page title"/>
<meta property="og:type" content="company"/>
<meta property="og:url" content="http://mysite.com/"/>
<meta property="og:image" content="http://mysiteimage.jpg"/>
<meta property="og:site_name" content="My Site Name"/>
<meta property="fb:admins" content="My_FB_Admin_ID"/>
<meta property="fb:page_id" content="My_FB_Page_ID" />
<meta property="fb:app_id" content="My_FB_App_ID" />
<meta property="og:description" content="Desctiption of page"/>

This is the FBML I'm using:

<fb:like width="940" action="recommend" font="lucida grande"></fb:like>

This is the Facebook Javascript SDK code I'm adding to each page before the </body> tag (it is only being added once per page):

<div id="fb-root"></div>
<script>
    window.fbAsyncInit = function() {
        FB.init({appId: 'My_FB_App_ID', status: true, cookie: true,
        xfbml: true});
    };
    (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
        '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
    }());
</script>

Does anyone have any idea what the heck I should be doing? Should I be using an app as the fan page or the page I'm already using??

I would also really like to be able to 'Like/Recommend' the actual Facebook page from the site, is this possible?

Many thanks in advance.

Zander

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

以歌曲疗慰 2024-09-21 01:10:51

该问题与 meta 属性 og:type 有关。除了文章之外的任何内容(如视频/音频等)都将在开放的社交图谱上创建一个新的 Facebook 页面。

如果将 og:type 设置为 article 或将其完全删除,问题就会消失。

我希望这有帮助。

The issue has to do with the meta property og:type. Anything other than article like a video/audio etc. will create a new Facebook Page on the open social graph.

If you set og:type to article, or remove it altogether, the issue will go away.

I hope that helps.

绿光 2024-09-21 01:10:51

无论您将“喜欢”按钮放在哪里,您都可以在其上指定 url,因此通过这种方式,只会创建一个“页面”,例如:

your created html location = http://mywebsite.com
some other stuff

    <!-- like button -->

     <fb:like href="http://mywebsite.com" layout="button_count" show_faces="false" width="200" font="lucida grande"></fb:like>

    <!-- end like button -->


your other created html location = http://mywebsite.com/help

some other stuff

    <!-- like button -->

     <fb:like href="http://mywebsite.com" layout="button_count" show_faces="false" width="200" font="lucida grande"></fb:like>

    <!-- end like button -->

正如您在此处看到的,无论您的“喜欢”按钮位于哪个页面,都始终会创建相同的页面,甚至更多你可以在上面指定你的页面应用程序。

请记住,如果您指定 url 和相同的内容,即使“元属性”标记也始终会创建相同的页面,如果您将某些部分留空,facebook api 将假定当前 url 而不会采用任何其他参数。同样适用对于评论,如果您指定 url,则可以拥有相同的评论框,其中包含相同的评论。

No mather where you place the "like" button you can specify the url on it, so in this wayonly one "page" is created ex:

your created html location = http://mywebsite.com
some other stuff

    <!-- like button -->

     <fb:like href="http://mywebsite.com" layout="button_count" show_faces="false" width="200" font="lucida grande"></fb:like>

    <!-- end like button -->


your other created html location = http://mywebsite.com/help

some other stuff

    <!-- like button -->

     <fb:like href="http://mywebsite.com" layout="button_count" show_faces="false" width="200" font="lucida grande"></fb:like>

    <!-- end like button -->

as you see here no mather what page your "like" button allways create the same page, even more you can specify your page aplication on it.

Remember even the "meta property" tags allways will create the same page if you specify the url and same content, if you left some part blank the facebook api will asume the current url and not will take any of the other parameters.Tha same apply to comments you can have the same comments box with the same comments on it if you specify the url.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文