So you need a public URL with meta tags to represent an object in the OpenGraph, and one of the required meta tags is a URL property. When the action gets published, it links to this URL property.
Let's say I'm on http://mysite.com/A. It seems like I can't then do this:
<meta property="og:url" content="http://mysite.com/B"></meta>
Because Facebook will try to look at the root url for the meta tags. Is there any way to link to a different URL (mysite.com/B) from a given OpenGraph object URL (mysite.com/A)?
You do not ever need og:url . Instead, use the existing rel=canonical standard to link to your canonical page URL. Facebook's own documentation states they support this [1]. Facebook treats the following as redirects before scraping: HTTP redirects, rel=canonical links, and og:url .
Open Graph meta tags are snippets of code that control how URLs are displayed when shared on social media. They're part of Facebook's Open Graph protocol and are also used by other social media sites, including LinkedIn and Twitter (if Twitter Cards are absent). You can find them in the <head> section of a webpage.
Open Graph (OG) is a technology that social networks like Facebook, Twitter, Pinterest, etc., use to pull data from your site when you add a URL of your site in any of your posts on these services.
og:url This Open Graph tag is particularly useful if you have more than one URL for the same content and want to designate one for all your social shares. This tag will dictate the canonical URL for your page.
You should be able to link to another URL. But all an og:url
means is "go over to that URL and use the tags from there instead". You can either
1) put all your tags on A
and then redirect users to B
with JavaScript or User-Agent detection;
2) put your content on A
and do an og:url
to B
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With