How to get Facebook Insights working for your website
I found this workaround whilst trying to get Facebook Insights working on this actual website. Creating the Opengraph tags was easy enough, but when I came to claim admin rights on the website it just wouldn't work.
Clicking the 'Get Insights' button just generated the error message 'No admin data found at root webpage...'. I'd reached a dead end which was really frustrating given that this was something so simple.
I thought about it for a minute. As I'd not put any admin tags (fb:admins) on the home page yet, the error was to be expected. The question was where could I get the fb:admins tag?
All the support forums and articles I read said that the popup under the green 'Insights for your website' button was meant to generate the fb:admins tag for you and display it on the popup window. After pasting this tag into the header on your site, clicking the 'Get Insights' button would then scan your site without any issues.
The problem was that there was no admin tag shown at all!
I was using Internet Explorer 9, a browser that seems to have more problems every day. So I switched to Firefox expecting this issue to suddenly disappear but I was out of luck, I still couldn't see the fb:admins code. The element (highlighted in blue below) was still blank.
I was on the right track though. I had a hunch the tag was there somewhere, the browser was just not displaying it on the screen and I was right.
From Firefox I fired up Firebug to look at the HTML source. If you're doing any kind of web development you should have Firebug already, if not get it now. Finding the source behind an element in Firebug is really easy, there's no need to wade through line after line of code, just point and click on the area you're interested in and you'll see the underlying HTML. It was there that I found the fb:admins meta tag hidden in the code.
I pasted the tag into the site header, clicked the button and it worked.
I've no idea why this Facebook page is broken. It looks like the issues people have been having with this go back some time, but it's still not working.
A quicker way to get the fb:admins tag
If you've been through the process described above, you may have realised that the number used in the fb:admins tag is just your own Facebook ID. So if it's just yourself that needs admin rights, do this...
- Using Firefox & Firebug again, login to Facebook
- Inspect your Facebook profile picture
- The HTML code behind it should look like this
- Extract your own Facebook ID from the code eg. 012345678 and build your own meta tag
It's quite easy really, but I had to go through the first method before I realised how simple it was.