<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WebAnaBlog.com &#187; Facebook</title>
	<atom:link href="http://www.webanablog.com/tag/facebook/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webanablog.com</link>
	<description>Analytics Insights and Other Web 2.0 Thoughts from My Random Stream of Consciousness</description>
	<lastBuildDate>Thu, 07 Jan 2010 21:15:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Tracking Facebook Fans in Omniture SiteCatalyst</title>
		<link>http://www.webanablog.com/2009/12/24/tracking-facebook-fans-in-omniture-sitecatalyst/</link>
		<comments>http://www.webanablog.com/2009/12/24/tracking-facebook-fans-in-omniture-sitecatalyst/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 18:52:53 +0000</pubDate>
		<dc:creator>ABatten</dc:creator>
				<category><![CDATA[Omniture SiteCatalyst]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[SiteCatalyst]]></category>

		<guid isPermaLink="false">http://www.webanablog.com/?p=6</guid>
		<description><![CDATA[In an effort to gather more data around &#8220;social media presence&#8221; in Omniture SiteCatalyst, I began investigating how to pull Twitter and Facebook data into Omniture SiteCatalyst.    After reading @VaBeachKevin&#8216;s post on importing Twitter Followers into SiteCatalyst on WebAnalyticsLand.com, I wondered if it would be possible to use the same concept to import Facebook [...]]]></description>
			<content:encoded><![CDATA[<div align="right" style="float: right; padding: 0px 0px 5px 5px;"><a name="fb_share" type="box_count" share_url="http://www.webanablog.com/2009/12/24/tracking-facebook-fans-in-omniture-sitecatalyst/"></a></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.webanablog.com%2F2009%2F12%2F24%2Ftracking-facebook-fans-in-omniture-sitecatalyst%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.webanablog.com%2F2009%2F12%2F24%2Ftracking-facebook-fans-in-omniture-sitecatalyst%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In an effort to gather more data around &#8220;social media presence&#8221; in Omniture SiteCatalyst, I began investigating how to pull Twitter and Facebook data into Omniture SiteCatalyst.    After reading <a title="VABeachKevin on Twitter" href="http://www.twitter.com/vabeachkevin" target="_self">@VaBeachKevin</a>&#8216;s post on importing Twitter Followers into SiteCatalyst on <a title="WebAnalyticsLand.com" href="http://www.webanalyticsland.com">WebAnalyticsLand.com</a>, I wondered if it would be possible to use the same concept to import Facebook Fans.  After a bit of searching, I found <a title="Getting facebook fan counts using FQL" href="http://stackoverflow.com/questions/1888515/fan-count-for-a-facebook-fan-page">this</a> post at stackoverflow.com, and I was off and running.  Here&#8217;s how I did it&#8230;</p>
<p><span id="more-6"></span></p>
<ol>
<li>As I mentioned, I relied on the code at WebAnalyticsLand.com to get me started.  Specifically, I grabbed the code in Kevin&#8217;s post here: <a title="Track Twitter Followers in SiteCatalyst" href="http://webanalyticsland.com/sitecatalyst-implementation/track-the-number-of-your-twitter-followers-in-sitecatalyst/">Track the number of Twitter Followers in SiteCatalyst</a></li>
<li>To use the PHP solution from above, I also had to download the Facebook PHP client library. To do that, go here: <a title="Facebook PHP Client Library" href="http://wiki.developers.facebook.com/index.php/PHP" target="_blank">Facebook PHP client library</a>. The specific files you&#8217;ll need from the library are facebook.php and config.php.</li>
<li>You&#8217;ll need to modify config.php to contain your <strong>API Key</strong> and <strong>Secret Key</strong> from Facebook.  I set up a testing Facebook APP to get one.   Go here: <a href="http://www.facebook.com/developers/apps.php">http://www.facebook.com/developers/apps.php</a> From my experience, it didn&#8217;t matter what account/app keys I used for these; the API and Secret Key are just needed to create the Facebook object in the code.  You can remove the database info from config.php.  This won&#8217;t be needed, as we don&#8217;t need to query any local DB.</li>
<li>Upload config.php and facebook.php to the directory where your script will run.  I created a subdirectory for this.</li>
<li>Finally, here is the PHP template I used: <a title="Get Facebook Fans and Add to Omniture" href="http://www.webanablog.com/getFBFans.zip">Get Facebook fans and Add to Omniture</a></li>
<li><a title="Get Facebook Fans and Add to Omniture" href="http://www.webanablog.com/getFBFans.zip"></a>At the top of getFBFans.php, make sure the following lines reference the correct location of config.php and facebook.php:<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;"><br />
include_once &#8216;facebook.php&#8217;;<br />
<span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;"><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">include_once &#8216;config.php&#8217;;<br />
</span><br />
</span></span></li>
<li>In the block beginning at line 14, edit the commented lines for the appropriate Omniture details and Facebook page ID. To get the Facebook page id, I found it easiest to search for the fan page, then click on the main profile photo. The URL will then show you the page/account ID. For example: <a href="http://www.facebook.com/album.php?profile=1&amp;id=6181619439">http://www.facebook.com/album.php?profile=1&amp;id=6181619439</a>.  The id <strong>6181619439</strong> is what you&#8217;ll put at line 23 in getFBFans.php.</li>
<li>The event you use in SiteCatalyst MUST be configured to <strong>numeric</strong>, rather than <strong>counter.</strong> Go into SiteCatalyst Admin settings for the respective report suite to configure this.</li>
<li>Upload getFBFans.php to a PHP server. Any time you hit that PHP file, it will perform the FQL query to Facebook and import into Omniture using the Data Insertion API.  My suggestion is to set up a cron job to run the script hourly,  for hourly trending in SiteCatalyst. <strong>NOTE: Running this script more than once per hour will inflate fan count!</strong> It is very important that you <strong>only</strong> run the script once per hour.</li>
</ol>
<p><span style="color: #ff0000;">EDIT: After looking at the data as its coming in, I think I will reschedule this script to run once per day. Because hourly granularity in SiteCatalyst can only be viewed for a maximum of 14 days, it&#8217;ll be much easier to see trends over large date-ranges by looking at a daily granularity.</span></p>
<p>And that&#8217;s it!  Of course, if you notice any issues with my explanation or the code in the files, <strong>please</strong> let me know so I can make corrections.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webanablog.com/2009/12/24/tracking-facebook-fans-in-omniture-sitecatalyst/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

