Facebook Meta Tags for Drupal

I was having trouble getting Facebook “Likes” and Facebook “Shares” to properly pickup my page summaries any time someone would “Like” or “Share” a page.  Instead of picking up the first few sentences of text from the page, Facebook was picking up my Adsense code – showing (Adsense code) jibberish on people’s Facebook Wall any time they shared one of my pages.  Facebook was also picking up the wrong images to display with the “Share”.

After 3 minutes of research and by using the Facebook Debugger Tool (VERY helpful!) I found that the Facebook crawler was confused by my lack of Open Graph (OG:) Meta tags.  I was using the Facebook Social Drupal Module but it only provides the bare minimum Open Graph meta tags for Shares and Facebook “Likes”.

For getting these additional Facebook meta tags, I found the Drupal Open Graph Meta Tags Module.

This module makes it easy to add Open Graph meta tags (http://opengraphprotocol.org/) to a node to enable it to be come a “rich” social object. For instance, Facebook uses this information to work out how to preview shared content in a user’s Facebook profile (http://developers.facebook.com/docs/share).

This module makes it easy to select the image thumbnail used to represent the node (used by Facebook when constructing a preview). The editor is shown a list of thumbnails of all images associated with the node (both as fields as well as images embedded within the node’s body content).

If need be, meta tags can be restricted to specific content types and access to administering and editing meta tags can be restricted by role using Drupal’s built-in permissions system.

After getting your Open Graph meta tags configured, you may notice that when Sharing or Like-ing pages, Facebook is still not seeing your tags – this is because the Facebook crawler has the old page cached.  You can force the Facebook crawler to re-crawl your page and update it’s cache by using the Facebook Debugger Tool.  Just enter the URL and hit the DEBUG button, and the Facebook crawler / bot will recrawl your page and update the Facebook cache.

Mailbag: How Do You Backup Your Drupal ?

Drupal LogoI received this question from a webmaster at one of the webmaster forums I waste too much time at:

Hello,
I have read your success story. It was really impressive. You mentioned that you use Drupal and also mentioned that once you lost your Database. So can you please give me some advice on a back up solution for Drupal? Do you use any online back up?
Your help will be greatly appreciated. :)

Yes.. It’s true.. It is shameful, but I admit it. In what is now referred to as “the crash of 06″ I did lose the Drupal database for my best earning site. Because the only backup that I had was weeks old, I lost quite a chunk of data – like posts/nodes/comments/user accounts. It was a shameful time and it brings up many bad memories of the taste of Tums and hair being pulled from my head.

So, yah, i did learn from my mistake of not backup up my Drupal database – so hopefully now you can learn too!

My current backup scheme goes something like this: My server is now configured with a dedicated backup drive. Each day WHM/cPanel makes complete copies of all accounts on the server, including all files and MySQL databases. So at any given time I have backups from the last several days, last weeks, and few from each of the last 5 years on that drive. In addition to those daily backups, several times per week I create a duplicate of the live database in PHPMyAdmin and download it to my local computer. I leave a few of those duplicate databases in PHPMyAdmin for easy access should I ever need it. Since the Drupal files do not change often, I get full-file downloads about once per month or any time I apply a Drupal core upgrade and store them on my Mac with the database files.

The databases & files that get downloaded to my computer stay on their own partition for approx 1 year. They also get automatically backed up to an external HDD. And, just for a little extra peace of mind, they also get uploaded to an offsite/online backup service. So, at any given time I have multiple copies of multiple databases and file-sets in multiple places.

As for automated/online backups for Drupal or Backup Modules – I don’t really trust them. I am more comfortable exporting my databases from MySQL and getting my files via sFTP. I do use an online backup/storage service – but it is backing up the data from my Mac at home and not my server. I would not trust anything connecting into my server. At least I can keep my Mac turned off at night but my server is up 24/7.. Call me paranoid..

What about you Drupal and WordPressers? Are you taking any steps to backup your website files and database? Dont make the same mistake I did!

Free: Ways To Monitor Your Website

Website Response Time GraphIf your site is important to you, particularly if the website generates income, you want to be sure that it is always online and secure.  To help keep an eye on my site(s), I’ve come across two services that do just that, and they do it for FREE (restrictions may apply):

Droptor:
Droptor.com is specifically for Drupal websites. Droptor does multiple checks to ensure that your Drupal website is using the most current modules, is secure and is fully optimized for SEO. Droptor also tracks and graphs activity such as new users, failed logins, & page/node creation. Especially valuable are the ways that Droptor logs page-memory usage and page-load times to help you optimize the performance of your website. Droptor is free for one website, and only $2/month for each additional website.

Pingdom:
Pingdom.com works with all websites & CMS’s and will monitor your website uptime and response times from all over the world 24 hours per day, 7 days per week.  You can configure custom alerts via sms, email, and even push-notifications to your iPad or iPhone. If you use a firewall you may need to whitelist Pingdom to prevent them from being blocked (which will happen if you have aggressive blocking) to prevent false alarms. If your firewall blocks Pingdom, here are the IP address that you can add to your white-list:
83.140.19.38
70.32.40.2
174.34.156.130
82.103.128.63
96.31.66.245
67.228.213.178
208.43.68.59
72.46.130.42
173.248.147.18
173.204.85.217
174.34.162.242
85.25.176.167
204.152.200.42
67.205.112.79
78.136.27.223
67.192.120.134
207.97.207.200
207.218.231.170
95.211.87.85
83.170.113.102
74.52.50.50
74.53.193.66
212.84.74.156
94.46.240.121
84.246.230.247

Pingdom is free for one website and up to 20 SMS alerts per month (unlimited email and push alerts)

Drupal: Integrating Your Site With Facebook

After avoiding it for years, I’ve finally added some Facebook integration with the website. I don’t know why I avoided Facebook this long. I’m not sure if thought Facebook was just a ‘fad’ or I just didn’t think it would help in any way or maybe I thought that the integration would be too difficult. So far it turns out I was wrong on just about all counts.

It’s fairly easy to integrate things like Facebook “Like” buttons, “Facepiles”, etc. There are several Drupal Modules for Facebook to choose from. Which one you decide on depends on what you want to do, and compatibility with your existing modules – I started with the Facebook Social plugins integration module which is pretty simple to setup and gives you instructions for creating your Facebook App ID, etc. I had Facebook Social plugins up and running in just a few minutes – so much for being difficult.

It’s hardly been 48 hours since I built a “Facebook Page” for the website, and we’ve already gotten a few “likes”. Also, by adding the Facebook “Like” button to all of our pages I am now able to see how many times those pages had been ‘shared’ or “liked” over the years. I was shocked to see many pages that had been shared or liked hundreds of times! Facebook also has a great little analytics package called “Insights“, that once setup provides a webmaster with some startling demographics information about the people visiting your page.

 

Perhaps the most surprising of all are the results of the Facebook advertising campaign I setup. I was able to buy a CPM ad for only a few cents per 1,000 views. Even more surprising is that according to Adsense & Google Analytics, the CTR and earnings for visitors coming from Facebook is incredibility high! Man.. I was really wrong about that one..

As far as Facebook being a ‘fad’.. This is the one I was most wrong about. Over 600million Facebook members and still growing proves me more wrong every day!

If you haven’t setup a Facebook presence or at least tried/testing running a Facebook ad campaign I recommend you give it a try. You can see/follow/”Like” our new Facebook page (above) or my “public” Facebook profile (using my middle name instead of last name) here:

My Personal Page |

..

Drupal: Fix Attempting to re-run cron while it is already running

Drupal LogoMy Drupal installs have been running pretty darn smooth for a year or two. Seems like since I upgraded from Drupal 5x to Drupal 6x, a lot of those little “issues” went away. But lately I’ve been seeing this message more and more often:
Attempting to re-run cron while it is already running

The first time I saw the “cron is already running” error I went into a Googlebating frenzy to try and resolve the issue. I found (too) many suggestions like changing cron semaphores in the Drupal system table, running MySQL repairs, and throwing shells at the moon. Finally I came across a comment hidden in a post at Drupal.org that is simple, and for me, has fixed the dreaded ‘Attempting to re-run cron while it is already running’ error message 100% of the time.

To fix the Attempting to re-run cron while it is already running error:
are you ready for this? Just Clear your cache!
Admin|Site Configuration|Performance|(scroll down) – and hit the Clear Cached Data button .. boom – problem solved..