search
Carter Cole LinkedInCarters Twitter PageCarter Cole on Facebook Carter Coles RSS

Monday, December 21, 2009

Optimizing for Facebook Share with Cloaking (but its good cloaking)

Social media sites have made it easy for the everyday user to share content and going viral is now the name of the game... as a SEO guy i was wanting to optimize my CTR for my Facebook links the same way I engineer the text in tweets to increase the likelihood a user will interact... I quickly found Facebook's useful article about what tags they use to generate the links users share and quickly whip something up and give it a test...


heres the code:
<head>
<title>Carter Tomorrow Fund Donations</title>
<meta name="title" content="Help Give to the Carter Tomorrow Fund" /> 
<meta name="description" content="Show your support and help out with a small gift" /> 
<link rel="image_src" href="http://cartercole.com/images/exp.png" />

and get this result:

Notice how i have overridden the default title, description and image Facebook would share for this document... this is very neat in itself :) it can help us get our shared links noticed more and makes sure the user doesn't use wrong image on the page they are sharing. But it does have one disadvantage :( we have to live with these meta titles and descriptions for the rest of our users(not cool) so we employ a trick known as cloaking. Cloaking is usually referring to showing different content to search engines than regular users and is frowned upon but this type of cloaking is good cloaking because it HELPS the user. We will cloak only these special tags in the head to show when the Facebook's UA [facebookexternalhit] requests the page and show our other meta tags(the ones optimized for SEO instead of social media) to everyone else.

Here's both flavors of the code:

ASP

<head>
<%if(instr(Request.ServerVariables("http_user_agent"),"facebookexternalhit") > 0) then
'facebook%>
<meta name="title" content="Custom Facebook title for share link" /> 
<meta name="description" content="Description of link Facebook uses" /> 
<link rel="image_src" href="http://site.com/betterimageforpage.png" />
<%else%>
<meta name="title" content="Different title than Facebook sees" /> 
<meta name="description" content="Whatever description you want search engines to see" /> 
<%end if%>
And the other version:

PHP

<head>
<?if (strrpos($_SERVER['HTTP_USER_AGENT'], "facebookexternalhit") === false){
//not facebook?>
<meta name="title" content="Different title than Facebook sees" /> 
<meta name="description" content="Whatever description you want search engines to see" /> 
<?}else{?>
<meta name="title" content="Custom Facebook title for share link" /> 
<meta name="description" content="Description of link Facebook uses" /> 
<link rel="image_src" href="http://site.com/betterimageforpage.png" />
<?}?>
this code will show the custom social media text to Facebook and give everyone else the correct meta title and description... if you have any questions get me on twitter im @cartercole
Hope it helps and have a great day / night / whenever you happen to be reading this

Saturday, December 19, 2009

the poor mans web beacon | tracking visits on 3ed party sites

i recently got one of my posts republished on Seomoz

and ive reached hits on my post...

(which is funny because ive only gotten 83 total from my blog)
so how did i get this pageview data from this third party site? its easy if you can inject an image on the page... which most of the time is pretty easy to do if you are publishing an article on another site. so when i wrote my post i created a custom j.mp url (same as bit.ly btw) to the location of my follow me on twitter image. by using a short url pointed at an image as the src of my badge that i put at the end of the post i was able to track the number of views my article recieved... heres the code i used in the post
and here you can see all the info http://j.mp/juicebeacon+ (you can get info on any bit.ly url by adding the + at the end) as you normally would about referrer (where the image was loaded from) as well as location information about the visits your article recieved

if you have any questions you want answered bother me on twitter im @cartercole

Saturday, December 12, 2009

CarterBar Chrome Extension | Get updates for any Blogger Blog in Chrome




I have now built my own Chrome extension called CarterBar it will update you as i write articles on this blog...

im open sourcing this extension so if anybody else wants to modify it to use their Blogger Blog its pretty simple... just go into the code and replace any instance of blog.cartercole.com and replace it with the url of your blog. it uses some ajax to full the feed as json from blogger and reads the number of items the blog has. If there are new articles on the blog then it will alert you to how many articles you have missed since you have last visited the site.

i built this using the code from samples that google put out. This function from the gmail updater extension selects a tab based on url and opens a new one if it doesnt find the correct url.



its really easy to build a chrome extension because they have already implemented some of the new HTML5 features like local storage and such... and because its a chrome extension you dont even need to write cross browser :) another thing that was cool was the way the extension was packed... its all json


i encourage everyone to try it and build their own extensions its really easy!

Monday, December 7, 2009

google has gone realtime!

looks like Google finally has their realtime search running kinda like bings twitter search but better... and "Of course, none of this would be possible without the support of our new partners that we're announcing today: FacebookMySpaceFriendFeedJaiku and Identi.ca — along with Twitter, which we announced a few weeks ago" (from Google blog post)

i tried some of the searches and didn't see anything new.

i got it working!

for this query: search for [realtime search] on experimental Google. @mattcutts re-tweeted a link to this page that seems to use realtime search more. this is the way cool video that shows it working (and its got cool music) ill be posting more here as i find out more so check back soon