Search code examples
facebook-graph-apimetadatafacebook-opengraphfetchcanonical-link

Is it possible to extract metadata from fetched url instead of canonical url?


I have a Facebook like that links to a page on witch I don't have complete control: I can modify the <body> but not the <head> of the page... So I tried to set the link of the like button on a new page on which I have complete control, set the opengraph metatags on this page, and set an og:url that links to the original page.

But in the end Facebook tries to extract metadata from the og:url and overrides the metatags of the previous page... Is it possible to tell that I want to scrape metadata from the first fetched url and not from the og:url ?


Solution

  • There is no way to instruct linter to extract OpenGraph metadata from page which have URL different than one defined in og:url.

    Linter will always extract the meta tags from URL defined in og:url at the end of the chain...

    There is a way to do something other (which may, or may not fit your needs):

    You can create intermediate page that will have all the required OpenGraph including og:url pointing to that page (not the one you have no control over it). That page will only have meta-data and JavaScript/Meta redirect to the final page, so user who land this intermediate page will be redirected to the correct final page.

    Beware, this will associate all the likes not to the "final" page but to the intermediate one.