36

I am trying to get my website validated with the Facebook object debugger and I'm running into the following error:

Object at URL 'http://www.example.com/latest' of type 'smallteaser:teaser' is invalid because the domain 'www.example.com' is not allowed for the specified application id '597566643589666'.

This error makes perfect sense since I haven't allowed the example.com domain specific access to the Facebook app. But do I really have to?

What I would like to achieve is similar to how Tumblr works when a custom domain is used. Say, for example, the website www.davidslog.com: it has the following meta tags:

<meta property="fb:app_id" content="48119224995" />

   --> This is the Tumblr app ID


<meta property="og:url" content="http://www.davidslog.com/?og=1" />

   --> This is a custom domain which points to a Tumblr blog


<meta property="og:type" content="tumblr-feed:tumblelog" />

   --> This is a custom Tumblr object type (in namespace tumblr-feed)

And if you then compare this with, for instance, the domain theartofnotwriting.tumblr.com, which has the following metadata:

<meta property="fb:app_id" content="48119224995">

   --> This is the same Tumblr app ID

<meta property="og:url" content="http://theartofnotwriting.tumblr.com/?og=1">

   --> This is a different domain

<meta property="og:type" content="tumblr-feed:tumblelog">

You can clearly see that the same Tumblr app has multiple URLs and everything validates correctly.

So why is it that this Tumblr page validates correctly and mine doesn't? How can a Facebook app be configured to allow being used on multiple domains?

1

7 Answers 7

18

I ran into this same issue. I figured that Tumblr must have some sort of partnership in place with Facebook to get this special treatment ( ip whitelist? special api? ) -- so I contacted my former Partnerships Rep at Facebook to enquire.

I got to speak with a platform engineer at Facebook about this, and I was totally wrong. There is nothing special going on.

The reason why all the domains running on Tumblr are validating fine with a single app_id, is that the facebook debug tool only checks the validity of the og_tag's structure (at least when it comes to the app_id). It does not validate if the app_id is properly associated with the given domain.

You can test this by putting up a test page with the your app_id on two different domains -- they'll both validate as fine in the debug tool.

When it comes to actual Facebook API access, Tumblr does everything on their domain. When people do use Facebook buttons/etc on Tumblr, it is often through a third party proxy tool (like ShareThis) or with a non-api button embed. I couldn't find a single custom-domain running on Tumblr that used the Facebook API or app_id related buttons. If you can, I'd love to see it.

It's the not answer you want (or I want) -- but that is what is happening. Tumblr's app_id appears on all the domains, but only actually works on ".tumblr.com"; The Facebook debug tool doesn't actually validate the app_id.

17

How can a Facebook app be configured to allow being used on multiple domains?

If you try to add more than one domain in the app settings, you get an error that looks like this:

example.com must be derived from one of: Site URL, Mobile Site URL, Canvas URL, Secure Canvas URL, Page Tab URL or Secure Page Tab URL.

example.org must be derived from one of: Site URL, Mobile Site URL, Canvas URL, Secure Canvas URL, Page Tab URL or Secure Page Tab URL.

One solution is to set the "Page Tab URL" to a fake URL on example.org like so:

example.org/myfakepage

You don’t actually have to use the page tab for anything. This just allows you to add a second domain.

2
  • 2
    This worked for me! I'm a bit nervous about what FB will do if I have to go through a Review process - I'm guessing this might raise red flags. I guess one workaround is to make an actual fake Page Tab (that can be loaded and everything) for them to check out. Of course, we would just not reference this Page Tab anywhere else in our App.
    – rinogo
    Jul 21, 2014 at 17:21
  • can you please explain more what to do? i didnt understand. thanks!
    – ofir_aghai
    Jul 13, 2015 at 17:56
13

How can a facebook app be configured to allow being used on multiple domains?

It can’t. Facebook apps are tied to one domain (and subdomains thereof).

Imagine what would happen otherwise – someone could add lots of (big) websites to one single app, and then f.e. embed the JS SDK on each of them, and recognize a user that is connected to that app over “half the internet” … and thereby track their (almost) every step.

Facebook of course does not want this¹ – because they want to make money of the data they collect about users and their movements through the web (they can in theory track you on every single website that uses a simple like button) – they would be stupid if they gave that same ability to every app developer.

¹ OK, that’s my own assumption.

10
  • I see what you're saying but if you look at the Tumblr example in my original post, then they are clearly using multiple domains with the same App ID and it all validates correctly... So how can it work for the Tumblr app but not for mine or yours?
    – stikkos
    Sep 1, 2013 at 15:50
  • Consider that it’s always possible that for the “big players” Facebook loosens the rules that are in place for the “average” developer.
    – CBroe
    Sep 1, 2013 at 15:57
  • Really??? That sounds very strange to me, especially considering Facebook wanting to buy Tumblr and then loosing it too Yahoo. It just doesn't make sense to me...
    – stikkos
    Sep 1, 2013 at 16:00
  • So when are you considered a "big player" and is there a formal workflow for requesting this privilege from Facebook? I can't find anything about this in the documentation...
    – stikkos
    Sep 2, 2013 at 14:06
  • 1
    Spend a couple of $100K a month on advertising on FB, then you get an actual account manager that you can talk to :-)
    – CBroe
    Sep 3, 2013 at 8:01
12

You cannot add multiple domains, unless the domains differ only by extension or subdomain.

In the example below, cuponeados differs only by domain extension (.com vs .com.ar), so both cuponeados.com.ar and cuponeados.com are allowed:

enter image description here

See this answer here: Need to add multiple domains in a single Facebook Application

5
  • 2
    To some degree this solution works, but be warned it rejects localhost URLs.
    – Ash Blue
    Sep 29, 2014 at 20:40
  • 3
    For localhost, try setting up some domain in your hosts file that resolves to 127.0.0.1 (e.g. dev.mysite.com) and use that in FB.
    – demisx
    Feb 28, 2015 at 16:28
  • 16
    Note that this is not a solution. I cannot add any site URL that is not completely in the app settings already, it will in fact error out on save and tell you what fields value cna be used here
    – Sammaye
    Mar 5, 2015 at 11:37
  • 3
    Wrong! With your solution you can only add ONE site url and HAVE TO define the same domain as your site's url. And the question was about multiple domains for one app.
    – Green
    Jul 13, 2016 at 9:43
  • 1
    @Sammaye You are right. I just edited this solution so that it is now correct.
    – modulitos
    Jun 10, 2017 at 5:50
5

The way Tumbler does this is to allow sub domains under their domain using *.example.com. This will permit all the sub-domains to work with their app (like odisharkins.example.com, facebook.example.com). There are certain aspects to adding several domains: look at the Facebook Blog.

Further domains must be derived from one of: Site URL, Mobile Site URL, Canvas URL, Secure Canvas URL, Page Tab URL or Secure Page Tab URL.

odisharkins.tumbler.com would not be an issue: it would work fine!

However, harkinstech.com or odisharkins.com will not work.

2
  • 1
    I ended up doing it like this and I now use the sub-domain url in the og:url. Do note that you still have to allow specific access for the Facebook Agent to bypass the sub-domain redirect... The strange thing is that Tumblr actually does it differently, check developers.facebook.com/tools/debug/og/… it doesn't make sense that this validates...
    – stikkos
    Sep 7, 2013 at 19:42
  • That's not how this example was done. The Facebook debug tool shows no data on the 2LD pointing to the 3LD tumblr subdomain. Jun 17, 2014 at 20:34
0

Worked for me: "The trick is to specify multiple app domains and use a comma separated list of valid URL's for the website URL configuration."

https://www.sitepoint.com/community/t/single-facebook-app-with-multiple-domains/99834/4

1
  • 4/19/17 - so this (seems to) have worked to allow multiple domains to auth. add a platform > website, then add multiple URLs space separated. https://example.com/ https.example2.com/. The domains will NOT validate in the App Domains field, but so far auth works for them. commas wont work, they break the one with the comma, but the one after the comma works...
    – keen
    Apr 19, 2017 at 22:08
-7
  1. Go to developers.facebook.com.
  2. Click on your application and edit the settings.
  3. Add domains to that in the following form: example.com, example.org, subdomain.example.com (no http).
  4. Save.

That’s the only way to do it, at east for the present time. You either add domains (and subdomains) manually or you can’t proceed.

6
  • 1
    I know how to add them manually but i am trying to use a dynamic domain. Do you think Tumblr will add every custom domain manually? And by the way, you can't add multiple domains that way since facebook will give the error 'domain must be derived from one of: Site URL, Mobile Site URL, Canvas URL, Secure Canvas URL, Page Tab URL or Secure Page Tab URL.'
    – stikkos
    Sep 1, 2013 at 15:27
  • Your quuestion is listed under Facebook. Tumblr has nothing to do with this. "[Whatever] is invalid because the domain 'www.skydivemag.com' is not allowed for the specified application id '597566643589666'", if it's a facebook error, it due to the fact that you didn't list the domain.
    – tattvamasi
    Sep 1, 2013 at 15:30
  • I am giving Tumblr as an example and I am asking how Tumblr manages to configure multiple domains for the same App Id... I don't think they do it manually like you suggested (and which doesn't work)
    – stikkos
    Sep 1, 2013 at 15:31
  • if you have a problem with Tumblr, ask their support. If your error is a Facebook error, I'm pretty sure it's that. Try it.
    – tattvamasi
    Sep 1, 2013 at 15:33
  • You really aren't listening... 1) try it yourself, you will get the error 'domain must be derived from one of: Site URL, Mobile Site URL, Canvas URL, Secure Canvas URL, Page Tab URL or Secure Page Tab URL.' and 2) i am looking how to use the same app id on multiple domains without adding the domains manually. This must be possible since Tumblr does it (hence the example)
    – stikkos
    Sep 1, 2013 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.