Skip to content

Instantly share code, notes, and snippets.

@islaytitans
Last active December 6, 2015 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save islaytitans/bb3dbf685f97e936adde to your computer and use it in GitHub Desktop.
Save islaytitans/bb3dbf685f97e936adde to your computer and use it in GitHub Desktop.
How to add custom Facets and Elements to Sitecore.Analytics.Model.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<model>
<elements>
<element interface="Sitecore.Analytics.Model.Entities.IContactAddresses, Sitecore.Analytics.Model" implementation="Sitecore.Analytics.Model.Generated.ContactAddresses, Sitecore.Analytics.Model"/>
...
<element interface="ISlayTitans.CMS.xDB.Interfaces.Facets.IKeyInteractionsFacet, ISlayTitans.CMS" implementation="ISlayTitans.CMS.xDB.Facets.KeyInteractionsFacet, ISlayTitans.CMS" />
<element interface="ISlayTitans.CMS.xDB.Interfaces.Elements.ISwatchDownloadedElement, ISlayTitans.CMS" implementation="ISlayTitans.CMS.xDB.Elements.SwatchDownloadedElement, ISlayTitans.CMS" />
<element interface="ISlayTitans.CMS.xDB.Interfaces.Elements.IVideoPlayedElement, ISlayTitans.CMS" implementation="ISlayTitans.CMS.xDB.Elements.VideoPlayedElement, ISlayTitans.CMS" />
<element interface="ISlayTitans.CMS.xDB.Interfaces.Elements.ISampleOrderElement, ISlayTitans.CMS" implementation="ISlayTitans.CMS.xDB.Elements.SampleOrderElement, ISlayTitans.CMS" />
</elements>
<entities>
<contact>
<factory type="Sitecore.Analytics.Data.ContactFactory, Sitecore.Analytics" singleInstance="true" />
<template type="Sitecore.Analytics.Data.ContactTemplateFactory, Sitecore.Analytics" singleInstance="true" />
<facets>
<facet name="Personal" contract="Sitecore.Analytics.Model.Entities.IContactPersonalInfo, Sitecore.Analytics.Model" />
...
<facet name="KeyInteractions" contract="ISlayTitans.CMS.xDB.Interfaces.Facets.IKeyInteractionsFacet, ISlayTitans.CMS" />
</facets>
</contact>
</entities>
</model>
</sitecore>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment