My question is about multiple FB IDs being created for the same URL. For example:
If I go to graph.facebook.com?ids=http://www.imdb.com/title/tt0981324/ I get this ID:
289135387789014
However, if I click the Like button on that IMDb page (or even if I create a new Like button on an external page with that URL in the fb:like link) then the ID that actually shows up in my list of Likes is:
318006948223183
Using these ID’s at the end of the graph like this: graph.facebook.com/318006948223183 or graph.facebook.com/289135387789014 brings up different data, but both have the exact same URL.
Only the SECOND ID actually gets Liked, ever, when someone clicks on the FB Like button for that URL. But only the FIRST shows up when you look up the information for that URL by doing graph.facebook.com/?ids=http://www.imdb.com/title/tt0981324/
So my question is – how do I make sure that I get the correct ID for URLs that have multiple associated FB IDs. I need to be able to look up the URL to find the ID, and then be sure I have the ID that actually shows up in the list of Likes when someone clicks the Like button.
There is a # sign in the href parameter of the Like button for your IMDB Movie. Because of that discrepancy between the page URL and the Like button href URL, two different Open Graph objects are created. The graph ID tied to your Like event corresponds to the URL in the href parameter of the Like button. Note that the “og:url” or “Canonical URL” is simply the link that will show up in the Facebook news story, and can be associated with multiple different graph items.
Here is the graph API data (showing 1 Like) for the URL without the # sign:
http://developers.facebook.com/tools/explorer?method=GET&path=%3Fids%3Dhttp%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt0981324%2F
Here is the graph API data (showing 575 Shares) for the URL with the # sign:
http://developers.facebook.com/tools/explorer?method=GET&path=%3Fids%3Dhttp%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt0981324%2F%23
Normally you can retrieve the graph ID from the URL by using the Graph API Explorer, or by doing an FQL Query:
SELECT url, id, type, site FROM object_url WHERE url = “http://www.imdb.com/title/tt0981324/#”
However, for the URL with the # sign, these tools will return only limited graph information, because no Open Graph meta tags are associated with that specific URL, and so the graph object isn’t fully initialized. So your existing solution of finding the object in your list of Likes is probably your best option for finding the specific graph ID tied to the Like event.
But even though ID #318006948223183 is tied to the Like events, ID #289135387789014 is the ID tied to the Canonical URL (without the # sign) and contains all of the most important meta content for the page.