Tuesday, January 29, 2013

“Dynamic” Goals in Sitecore CEP and Google Analytics

A quick aside as I continue to compare and contrast my experience setting up GA with my current understanding of Sitecore CEP….

I started thinking about Goals in a much more dynamic way.  While I appreciate the Engagement Value that Sitecore assigns to the Goals you can model directly in the system, I often get the feedback that goes something like, “yeah, but we might have one goal that would be worth very different things based on other factors, like where it’s accomplished, on which site, based on whether the visitor has accomplished something else”, etc., etc., etc.

As always, in ECommerce this is usually pretty straightforward.  Goal = Purchase, and Value = Invoice Total.  With most of our Goals, though, the Value can be much harder to agree on.  I like the example here of a site registration Goal.  Two different departments might have this same Goal, but they might weight it very differently in terms of Value.  One department has determined that registration leads to a particularly high ECommerce conversion rate, so they feel the act of registration itself should be high up the Engagement Value pyramid.  Another department, while still wanting to track the Registration goal occurrence, hasn’t seen the same focused correlation towards their interesting conversions.

While we can certainly consider setting up different Goals for the different purposes (and starting down the path of Department 1 Registration, Department 2 Registration), what I like about the opportunity of this use case is to detach the Engagement Value from the Goal itself.  The simplest code sample I could think of is below:

if (Sitecore.Analytics.Tracker.IsActive)
Tracker.CurrentVisit.Value += 1000;
 



where we arbitrarily add 1000 Engagement Value points to the current Visit.  While this is oversimplified, it highlights the main point here….let additional logic determine the actual Engagement Value based on additional criteria (in the Sitecore Context or otherwise),  and then promote the simple maintenance of that additional criteria.

Tying to a CRM for an attribute like this could be very interesting (salespeople determining the value of a demo request for their own region).  I also like the idea of modeling this as Sitecore content.  Maybe a Goal should look at where it is in Context to the content hierarchy (if the current item has a Value use it, if not look up the tree, etc.).  Probably better—model this in the Rules Editor (multiple clause condition like “if item is subitem of books section, and visit number is greater than 5”).

I started down this path as it’s taking me longer and longer to figure out how to model complex Goal achievement in Google Analytics.  Of course I’m quite biased towards Sitecore here, but thinking through the Sitecore API possibilities, coupled with allowing content authors easy maintenance has been quite a bit more exciting than considering all the landing pages I’d need so far in my Google Analytics Goal scenarios.  To be fair, I have to dig deeper into GA and see what I get from their API.