Maksym Ponomarenko
Sitecore Consulting

Sitecore Federated Experience Manager part one: FXM.Analytics


In the following two blogposts I want to describe the main features of the Sitecore FXM and show how to use and configure this amazing module. The main function of Sitecore Federated Experience Manager is to gather data for analytics, manage content, and personalize experiences of your non-Sitecore websites. It contains two subprojects: FXM.Analytics (first post) and FXM.Web (second post).

Federated Experience Manager: FXM.Analytics

FXM-OAlogo
So, lets first discuss the FXM.Analytics. It was created to allow you to track events within your non-Sitecore webpages. For example with Hermes you can collect analytics for your media pages (video started, video stopped at 6th minute and etc.) so that you always know how current your content is.

1. FXM.Analytics Configuration


FXM Client:


The client is very similar to google analytics. To track events you just need to add a few rows of js code:
<script>
var sitecoreUrl = 'http://sitecore.netzkern.de/';
var _scFxmAnalytics = _scFxmAnalytics || [];
_scFxmAnalytics.push(['_setDomain', sitecoreUrl]);
_scFxmAnalytics.push(['_trackEvent', {'data':'1', 'datakey':'dk', 'text':'some text'}]);
(function () {
  var js = document.createElement('script');
  js.type = 'text/javascript';
  js.async = true;
  js.src = sitecoreUrl + 'Fxm/Analytics/js/Client.js';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(js, s);
})();
</script>
 

FXM Server:


To receive requests from clients you should configure a module for each website. All of the configuration is provided in items. You don’t need to change the config file. Configuration items are located under “/sitecore/system/Modules/Federated Experience Manager/Analytics”.

So, first you should add the “Create External Applications” item.

create-external-applications-item


Here you can specify the exact domain and the way you want to retrieve request properties (from Query String or from Form parameters). To do this you need to select Query String Reader or Form Reader accordingly or both. Actually you can create your custom parameters reader. To do this you just need to create a class of your reader based on the interface Sitecore.Fxm.Analytics.Parameters.IParametersReader and implement its method “Read”. Then create an item under “Parameter Readers” and specify the type of your custom reader in field “Type”.


type-custom-reader 


When your Application item is created, you need to create a Configuration item under the “External Application Configurations” location. The item contains Rule field “Configuration” where you actually configure the tracking process of your websites. Another field is “External Applications”. It allows you to define your website domains for which the configuration is true.

configuration-item 

external-applications 


2. FXM.Analytics Testing


After the configuration is ready, you can check it by testing the page: http://[host name]/sitecore/admin/FXM/ Analytics/testpage.html
 
analytics-test-page

3. FXM.Analytics Cache provider


For good performance FXM.Analytics uses its cache provider to get Configuration items, to run rules. So after the first request, all data for the specific domain is received from the cache. The cache is cleared by updating configuration items.


4. FXM.Analytics Tracking Process


The tracking process runs in the pipeline.
<pipelines>
<fxm.analytics.trackOffsiteEvent>
<processor type="Sitecore.Fxm.Analytics.Pipelines.TrackEvent.CheckSecurity, Sitecore.Fxm.Analytics"/>
<processor type="Sitecore.Fxm.Analytics.Pipelines.TrackEvent.ResolveUri, Sitecore.Fxm.Analytics"/>
<processor type="Sitecore.Fxm.Analytics.Pipelines.TrackEvent.ReadParameters, Sitecore.Fxm.Analytics"/>
<processor type="Sitecore.Fxm.Analytics.Pipelines.TrackEvent.GetConfiguration, Sitecore.Fxm.Analytics"/>
<processor type="Sitecore.Fxm.Analytics.Pipelines.TrackEvent.GetEventProcessors, Sitecore.Fxm.Analytics"/>
<processor type="Sitecore.Fxm.Analytics.Pipelines.TrackEvent.Track, Sitecore.Fxm.Analytics"/>
</fxm.analytics.trackOffsiteEvent>
</pipelines>


In the next blogpost tomorrow I will talk you through the Federated Experience Manager FXM.Web.




Unter
Kommentare
1

Henri De Roeck

Excellent post, thanks!
What are your ideas on the feasibility of the following.
I have a Sitecore website (internet public) and a custom build extranet. What I would like to achieve that when a person that logs in into the extranet, his user profile in Sitecore (already existing or created with FXM) is updated with his name. So basically: I want to "push" userdata to Sitecore. Would this be possible if I add a custom tracking push entry and catch this in a new pipeline?
Tx again!

am 28.11.2014

2

Christopher Wojciech

Hi Henri,

is the custom build extranet based on Sitecore? So if he logs in there, he's logged in to Sitecore, right? I would not use FXM for the extranet if built on Sitecore. Then you can use the API directly.

You can push custom tags to the user and defintely add custom facts. If you use 7.5+ please see this: http://www.techphoria414.com/Blog/2014/August/One-Month-with-Sitecore-7-5-part-6

If you use previous versions you can start by checking adding custom tags to the analytics user profile.
In both situations you could use the engagement plans to process it further.

Let me know if this helps though.

Have a great one, best chris

am 02.12.2014

Kommentar hinzufügen
Vor und Zuname
E-Mail
E-Mail bei weiteren Kommentaren
Mein Kommentar