question

heath avatar image
heath asked

Facebook Purchase Items scrape as og:type="website"

I have an in game economy to be purchased via Facebook.

There are 4 items, and one of them works and the other 3 do not.

The failures (FB.Canvas.Pay part of the workflow) complain:

"{"callback_id":"14","response":{"error_code":1383146,"error_message":"invalid og type. Expected og:product, got website"}}

The payment url is:

https://7377.playfabapi.com/OpenGraphProduct/7377/facebook/GamePacks/goat.bundle.basic.pack

The four products are defined as bundles, and look identical in the Catalog Editor, except for their names and RM values. The bundles are contained in a store called "facebook". The catalog is called "GamePacks".

I'm assuming that the URL above serves this data with the required OpenGraph tags but I see no way to define those tags explicitly.

Again, 1 product succeeds while the other 3 fail. Here is the CURL output from an OpenGraph scrape:

{
    "share": {
        "comment_count": 0,
        "share_count": 0
    },
    "og_object": {
        "id": "1268394159860632",
        "title": "HERD",
        "type": "product",
        "updated_time": "2018-01-18T19:11:39+0000"
    },
    "id": "https:\/\/7377.playfabapi.com\/OpenGraphProduct\/7377\/facebook\/GamePacks\/goat.bundle.basic.pack"
}
{
    "share": {
        "comment_count": 0,
        "share_count": 0
    },
    "og_object": {
        "id": "1813020502073001",
        "type": "website",
        "updated_time": "2018-01-17T10:30:13+0000"
    },
    "id": "https:\/\/7377.playfabapi.com\/OpenGraphProduct\/7377\/facebook\/GamePacks\/goat.bundle.medium.pack"
},
{
    "share": {
        "comment_count": 0,
        "share_count": 0
    },
    "og_object": {
        "id": "2170325536314645",
        "type": "website",
        "updated_time": "2018-01-18T21:15:33+0000"
    },
    "id": "https:\/\/7377.playfabapi.com\/OpenGraphProduct\/7377\/facebook\/GamePacks\/goat.bundle.advanced.pack"
},
{
    "share": {
        "comment_count": 0,
        "share_count": 0
    },
    "og_object": {
        "id": "1781134185291224",
        "type": "website",
        "updated_time": "2018-01-18T16:56:45+0000"
    },
    "id": "https:\/\/7377.playfabapi.com\/OpenGraphProduct\/7377\/facebook\/GamePacks\/goat.bundle.premium.pack"
}

It's clear that the first, succeeding item has the proper type of "product" while the other 3 failing items are typed as "website".

The Facebook object debugger confirms this also:

https://developers.facebook.com/tools/debug/og/object/

I've search thru the docs and can't find anything related to this issue.. any help is appreciated.

In-Game Economy
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Siva Katir avatar image
Siva Katir answered

Where did you get the URL that you are using here? The correct format for that URL is actually (note the Game%20Packs to escape the space in the catalog name):

https://7377.playfabapi.com/OpenGraphProduct/7377/facebook/Game%20Packs/goat.bundle.medium.pack

Can you tell us how you are generating, or getting, that URL?

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

heath avatar image heath commented ·

Thats it!

This value was hard coded as a constant, in legacy code.

All of the CURL calls now report proper type, and Facebook object debugger successfully scrapes.

Thanks! I did notice that the Catalog "Game Pack" was named with a space and consumed without the space. I just assumed that the spaces were collapsed because one of the items succeeded.

I'm curious why the working url (without the space):

https://7377.playfabapi.com/OpenGraphProduct/7377/facebook/GamePacks/goat.bundle.basic.pack

actually worked..

I'll rebuild and verify the purchases go thru, then report back here.

cheers! -h

0 Likes 0 ·
heath avatar image heath heath commented ·

Indeed, all of the products are able to be successfully purchased and awarded.

Thanks again for the insight.

-h

0 Likes 0 ·
Siva Katir avatar image Siva Katir heath commented ·

For me that URL also doesn't work, our servers are returning "Unknown catalog item." in the response.

0 Likes 0 ·
heath avatar image heath Siva Katir commented ·

Yes, I believe it may have been cached in Facebooks graph api, resulting in a successful purchase.

I recreated that product (goat.bundle.basic.pack) yesterday, and after the re-creation, the Facebook scraper would fail.

This link shows it still exists on the graph, but any attempt to re-scrape fails:

https://developers.facebook.com/tools/debug/og/object/?q=https%3A%2F%2F7377.playfabapi.com%2FOpenGraphProduct%2F7377%2Ffacebook%2FGamePacks%2Fgoat.bundle.basic.pack

I was able to re-scrape until yesterday's recreation of (goat.bundle.basic.pack)

Possibly because the new scrape fails it persists the last known "good" record?

thanks,

-h

0 Likes 0 ·
Muhammad Hassan avatar image
Muhammad Hassan answered

I am dealing with the same issue and in my case there is no space in neither catalog name nor in store id and its giving me the same 404 error with bundles scraped as "website" instead of "product"

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.