Facebook share URL is not calling with query paramaters - facebook

A facebook share url for my site is for eg:
www.mysite.com?q=123
However, facebook is not calling the url with query parameters i.e ?q=123 is missing.
Is there a way to make facebook to use query parameters

The issues was meta tag og:title was assigned to "name" instead of "property".
Strangely, this somehow made facebook to ignore query parameters in URL.
Assigning meta tags to "property" made it work.

Related

How do I add query parameter to Facebook og:url meta tag without impacting ranking of my page?

I have a page which has open graph meta tags added to it. Now,I need to pass a query parameter to my page url, value of which will decide whether og:video meta tags has to be added to page or not. But as soon as Facebook crawler finds og:url, it ignores everything on the page and starts crawling canonical url given in og:url. If I add required query parameter to og:url, Facebook creates new indexing and my page ranking drops to 0.
For example:
Current Behavior:
My page url: http://www.example.com/mypage
with og:url value content="http://www.example.com/mypage"
New Behaviour which I want:
My page url: http://www.example.com/mypage?isValue=1
Page will have this check:
if isValue=1 , it will Add video meta tags on page
New page should have this og:url to propagate isValue=1 properly:
og:url content="http://www.example.com/mypage?isValue=1"
How can I avoid drop in my page ranking by new behaviour?
Is there anyway I can make Facebook crawl og:url with query parameter added to it without affecting my page ranking?
Any other way of doing what I need to do, would also be helpful.
That is the expected behavior. Facebook will always crawl the og:url aka the Canonical URL you are returning in your markup. Each URL is treated as a unique object, so if you are changing parameters, it will be a new object with 0 likes or shares.
It is also not considered good practice to have URL parameters as part of your canonical URL (see https://developers.facebook.com/docs/sharing/best-practices#tags)

Can a Facebook object have two URLs?

I'm creating an "object" via Facebook's Open Graph. Obviously it's assigned a unique URL within my application (e.g. www.myapp.com/something/hash), and I'm injecting the relevant OG meta tags. All fine, and I can then "attach" a "Like" button and Facebook comments.
However those user-created objects are generated from within a Facebook application - which happens to "live" under the same domain (e.g. www.myapp.com/fb) and that object has its own page within the Facebook application (e.g. www.myapp.com/fb/something/hash)
Thus, that same object has effectively two unique URLs. The "external" one is the one I use to identify it, but I also want to have a "Like" button and Facebook comments on that page. It doesn't seem to accept a URL in, say, the fb-like DIV and corresponding og:url meta tag that doesn't match the URl it's housed on.
Is there any way around this - or do I need to do something like a redirect when calling the page from within the Facebook app, or some sort of clever template switching?
Just set the og:url meta tag value for both URLs to the one URL you want to be the “actual” URL of the object.

Facebook comment/like url

Am having difficulty with the url for the facebook comment and like plugins. if I put in a simple url like "www.example.com" it works fine but my app is on a subdomain and uses querystrings to differentiate between different page states. So a sample url would be something like "facebook/example.com/index.php?id=001". However it appears facebook doesn't like this and keeps saying it is unreachable.
I can't believe facebook would limit the scope like this. Someone else must have encountered this. Any suggestions?
Facebook posts have an id something like 123456789012345_123456789012345.
The part prior to the underscore is the page id. The part after is the post id. The URL would be https://www.facebook.com/pageid/posts/postid, or https://www.facebook.com/123456789012345/posts/123456789012345.
Check your URL in Facebook's Debug Tool and this will show the tags Facebook is detecting on your page -in particular check your og:url tag isn't ommitting the URL parameters

Can You Have Your OpenGraph Object Link to a Different URL?

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 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.
#Paul, I didn't fully understand or appreciate your comment until now - apologies and thanks.
What I learned from a little more tinkering is that on the initial post to FB with the object item url in the post, is that FB then crawls that page, gets the META tags and if you've got og:url defined it will crawl it again. It crawls it twice.
In my case, I am passing a querystring that does get parsed, but I was not setting it again in the og:url, so when it crawled my page the second time, it was not picking up the querystring variable I needed it to.
That was a dumb thing on my part. Thanks for the great answer.
Jim

Link to fan-page with app_data parameter removes the app_data parameter

I have a FB app in an iframe on a Facebook fan-page. If I create a URL linking to that page, and that URL contains an app_data parameter, like this:
https://www.facebook.com/pages/My-Page/123?sk=app_456&app_data=mydata
Then post that in my FB feed, FB strips the app_data parameter, reverting to the canonical URL for the fan page:
https://www.facebook.com/pages/My-Page/123?sk=app_456
Which isn't what I want.
I would consider this a bug, as the state of the application is part of the "canonical" state of the fan page, but for now: Any way to get around this?
I have thought about making the bookmark to my own page:
https://facebook.mysite.com/pages/My-Page/123?sk=app_456&app_data=mydata
and dynamically generate a page with all the OpenGraph tags from the corresponding FB page (to make FB sharing work), and a redirect to the fan page (to get the user to the right place) - but this requires either (a) scraping FB for those OpenGraph tags or (b) accessing the graph.facebook.com api programmatically in a crawl-like fashion, and I don't know what FB thinks of that.
G'Day Leo, might be a bit of a hack but seems to work. I link my app_data onto a separately hosted URL and redirect back to Facebook with it.
So my URL I share is: https://externaldomain.com/deeplinker.aspx?data=stuff
Then response a redirect which is: https://www.facebook.com/[pageurl]?sk=[app]&app_data=[data]
With [data] = stuff