og:url is driving me crazy?

你。 提交于 2019-11-29 20:37:59

og:url basically tells the FB scraper "ignore anything on this page, and scrape this url instead" So it's doing exactly what it's supposed to do. If you want the like button to point to a different url, use the href parameter and have it point to a different url.

See https://developers.facebook.com/docs/reference/plugins/like/ for more information.

I think I understand what you are asking. Like @Jeff Sherlock said "og:url basically tells our scraper "ignore anything on this page, and scrape this url instead"..."

So if og:url is anything other than the current page -- Facebook will try to scrape the open graph data from there instead.

If this is a page you are trying to send people to if they click on the 'like object' that is posted to a users wall (who has already liked your page) --

I made a tool for this exact purpose -- as I thought it might be helpful to others:

Facebook/Open Graph Like button Generator

It generates (and stores) the open graph tag(s) so you don't need to put them in your page at all and the 'Redirect URL' tells it where to send all the traffic.

It detects the Facebook bot/scraper too so it won't interfere with anything :)

Good luck

you can put the like button in an iframe. Furthermore, that iframe may or may not need to be filled by setting a src attribute. I would try adding the like button code as innerHTML, and then try a separate file to set the src to.

It would look something like this:

<iframe><place like code here></iframe>

When that doesn't work, place the like code in a separate file, and set the src of the iframe to that file. Let me know if you have quesitons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!