To Set up and Test:

a) Use EPiServer Deployment Center to install a module from a zip file (select FacebookEventCriterion.zip)

b) Create a facebook app, set up site domain, site url, canvas url, and auth dialog settings. The canvas URL should point at a page of the EPiServer site. Once created, APP ID, App Secret, and APP URL will be generated and should be used in the next step. 

c) Update web.config:

    <facebookSettings appId="Your Facebook APP ID"
                        appSecret="Your Facebook APP Secret" />
    <appSettings>
        <add key="FacebookAccessToken" value="Facebook Permanent Access Token"/>
        <add key="FacebookAppUrl" value="Facebook App URL"/>
        <add key="FacebookPageUrl" value="http://your.domain/facebook.aspx"/>
    </appSettings>
	
    <episerver.shell>
	<protectedModules>
	    <add name="Criteria" resourcePath="~/">
                <assemblies>
                    <add assembly="FacebookEventCriterion" />
                </assemblies>
            </add>
        </protectedModules>
    </episerver.shell>

FacebookAccessToken needs to be generated using Source/GeneratePermanentToken.aspx. This file should not be deployed to the webroot, and should only be used by a developer. Before running, update GeneratePermanentToken.aspx.cs to match the APP ID and Your Site URL specified in the facebook app. 

d) Create a Visitor Group using Facebook Event Criterion. The events available from the dropdown are all events that the marketeer's facebook user is attending. This facebook user is also used to generate the permanent acccess token in the previous step.

e) On the page where the facebook app's canvas URL points at, add some content just for the visitor group created in the previous step.

f) Create a link at somewhere obvious of the site, linking to http://your.domain/facebook.aspx. This will authenticate the site visitor's facebook user, and let the facebook user authorise your facebook app to access information of the events she is attending. Then it will redirect the site visitor to the facebook app to view the personalised content.

g) Also, provide a link on the canvas page, linking to the URL of the facebook event. Once the site visitor's facebook user attends that event, she should see something different on the facebook app!


Reference:

http://world.episerver.com/Blogs/Magnus-Rahl/Dates/2011/3/Richer-UI-for-your-custom-Visitor-Groups-criteria/
http://world.episerver.com/Blogs/Paul-Smith/Dates1/2011/4/Providing-a-custom-view-for-your-Visitor-Group-criteria/
http://world.episerver.com/Blogs/Dan-Matthews/Dates/2011/9/Pulling-Facebook-events-into-EPiServer/
http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-6-R2/Visitor-Groups-Creating-Custom-Criteria/




