Sitecore Federated Experience Manager Developer's Guide€¦ · Sitecore Federated Experience Manager Developer's Guide Sitecore® is a registered trademark. All other brand and product
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Sitecore Federated Experience Manager Developer's Guide Rev: 21 February 2015
Sitecore Federated Experience Manager allows activity in non-Sitecore websites and applications to be tracked, and for content managed and personalized by Sitecore to be injected in non-Sitecore websites.
This chapter provides an overview of Sitecore Federated Experience Manager.
This section provides an overview of the capabilities of Federated Experience Manager.
1.1.1 Tracking External Sites
Sitecore Analytics allows you to better understand your customers' interests and activities. But if Sitecore is only able to track activity on channels managed by Sitecore, the understanding you are getting is not complete. Therefore, tracking activity on non-Sitecore web sites is an important part of a comprehensive customer engagement strategy.
Sitecore Federated Experience Manager allows you to use the tracking capabilities available on Sitecore web sites to non-Sitecore web sites using a common approach used by analytics vendors.
A small amount of Javascript is added to the non-Sitecore pages that need to be tracked. This Javascript makes a call to Sitecore when a visitor views the non-Sitecore page. Federated Experience Manager creates a Sitecore item that corresponds to the non-Sitecore page. This item is called a "mirror item". The mirror item gives Sitecore a means by which to track activity.
This approach allows Sitecore to use its standard request-handling process for requests to non-Sitecore pages. This means that all of Sitecore's tracking capabilities - profiling, goals, page events, engagement plans, etc. - can be used with non-Sitecore pages.
1.1.2 Personalizing External Sites
Tracking allows Sitecore to better understand your customers' interests and activities. But being able to collect this information is only a small part of the reason you would use Sitecore as a part of your customer engagement strategy. Being able to use this information in order to affect customer engagement is a bigger part of the reason.
Federated Experience Manager allows you to inject personalized content from Sitecore into non-Sitecore web sites. This personalization is able to use the information collect across all channels in order to provide your customers with the most relevant content, even on non-Sitecore web sites.
As explained in the Tracking section, non-Sitecore pages that are tracked have the Federated Experience Manager Javascript added to it. When a visitor views a non-Sitecore page, a request is sent from the visitor's browser to Sitecore. By handling this request Sitecore is able to track the non-Sitecore page view.
In addition to tracking the page view, handling this request also allows Sitecore to generate personalized content. The response that Sitecore returns contents any personalized content that should be injected in the non-Sitecore page. The Javascript that was responsible for making the request to Sitecore is also responsible for injecting the personalized content from Sitecore into the non-Sitecore page.
1.1.3 Tracking External Applications
Tracking is not limited to external sites. Federated Experience Manager allows you to track activity on external applications as well. For example, when a visitor leaves a comment on a non-Sitecore site you might want to record a page event in Sitecore.
This is accomplished by providing a web-based API that allows you to push activity data into Sitecore. After the activity data is passed to Sitecore, Federated Experience Manager allows you to configure how that data should be handled.
FXM Content Tracking rules are used to specify content tracking rules.
2.2.1 Custom Conditions
Custom conditions must use the type
Sitecore.Fxm.ContentTracker.Rules.TrackingRuleContext as the generic parameter when
inheriting from Sitecore.Rules.Conditions.RuleCondition<T>.
2.2.2 Custom Actions
Custom actions must use the type
Sitecore.Fxm.ContentTracker.Rules.TrackingRuleContext as the generic parameter when
inheriting from Sitecore.Rules.Actions.RuleAction<T>.
2.2.3 Apply Tracking Action Base
The most common use for a custom content tracking action is to apply the tracking settings specified on a Sitecore item. The type
Sitecore.Fxm.ContentTracker.Rules.Actions.ApplyTrackingActionBase<T> should be
extended for this type of action.
The following table describes the members of this type:
Method name Description
GetSourceItems(Item) When the Apply method is called, this method is invoked. The collection that is returned is passed to the content tracking pipeline.
The following table describes the members of this type:
Constructor Description
TrackingRuleContext(Item) Sets the Rule property on the rule context to the specified object. This object is the item which content tracking conditions and actions relate to.
instance that is able to record the page event specified by the event name parameter.
The rule context object may serve as the source of the properties on the page event.
Note: A custom single event parser will likely depend on the rule context object to provide the data that gets recorded on the page event. As a result, if you implement a custom single event parser it is likely that you will also need to configure custom actions in order to set values on the rule context.
3.2.2 Interface: IMultiEventParser
If you wish to create a custom multi- event parser, you should implement the interface
Sitecore.Fxm.Analytics.Parsers.IMultiEventParser.
The following methods must be implemented:
Method name Arguments Description
Parse Rule context Return a list of
IEventProcessor instances.
Note: Just like with custom single event parsers it is likely you will also need to implement custom actions in order to set the data you want to record in the page event into the rule context object.
Event processors are responsible for tracking. The external application tracking process determines which event processors should be used and then it executes those processors.
The most common reasons why you would develop a custom event processor is because you need a custom tracking action or a custom event parser.
3.3.1 Interface: IEventProcessor
If you wish to create a custom single event parser, you should implement the interface
Process This method performs a task, usually involving tracking. For example, the method may record a goal or it may set a score on the visitor's profile.
If the processor is going to track analytics it should check the value of Sitecore.Analytics.Tracker.IsActive
If the parameter readers that are included with Federated Experience Manager do not meet your needs, you can create your own parameter reader. To create a parameter reader you must implement the
This section covers how to customize the process of determining which placeholder selectors are available for a specific mirror item.
3.6.1 Mirror Provider
The mirror provider is the component that is responsible for determining which placeholder selectors are available for a specific mirror item. The default mirror provider is implemented in the type
Sitecore.Fxm.Web.Mirror.MirrorProvider.
3.6.2 Method: GetPlaceholderSelectors
The "GetPlaceholderSelectors" method on the mirror provider is responsible for returning the placeholder selectors assigned to a specific mirror item.
Name Description
Default implementation Returns the placeholder selectors that are assigned to the mirror item.
Argument: mirrorItem The mirror item whose placeholder selectors are to be retrieved.
Return value List of Sitecore.Data.Items.Item objects
If you wish to create a custom site resolver, you should implement the interface
Sitecore.Fxm.Web.Sites.ISiteResolver.
The following methods must be implemented:
Method name Arguments Description
ResolveSite Site definition item Returns the Sitecore.Sites.Site
instance that represents the external site.
This method should call the methods defined in section 3.7.2.
3.7.2 Site Extension Methods for Site Resolvers
Federated Experience Manager includes extension methods for the type Sitecore.Sites.Site.
These extension methods are defined in the assembly Sitecore.Fxm.Web. These methods are called
by site resolvers.
Method name Arguments Description
MarkAsFxmWebSite (none) Sets a property on the site that identifies the site as an external site. This property is used to determine whether the crawling process should run.
SetSiteItemId Site definition item ID Sets a property on the site that identifies the site definition item.