Tags

, , , , , , ,

The Sitecore DMS (Digital Marketing System) is an outstanding tool for marketing automation, personalization, content targeting, and much more. However, the DMS could also be rebuilt to be used as a very powerful tool for Gamification.

Sitecore DMS tree

The DMS contains many of the elements of which games are made:

  • Rules
  • Conditions
  • Profiles (for tracking character properties)
  • Goals
  • Flowchart

The problem is that the DMS data and logic are active “under the surface”, and that the visitor is only limitedly aware of it. If you make the DMS data and logic transparent, and show it to the visitor, you are well on the way of a making a Gamification engine.

For example, if you have a news website, you could classify your news items according to Profile fields: Domestic News, Foreign News, Economic News, etc. If the visitor would read a domestic news item, the DMS tracker would update his visitor profile, and add a +1 to Domestic News.

If you make the small adjustment to show this information to the visitor, you could show this as a kind of progress towards a certain goal. This is then similar to the famous gamification mechanic of LinkedIn of showing the progress of filling in all the fields of the user profile. Furthermore, you could then link this progress to a set of predefinied goals, and offers rewards to the visitor to achieve these goals. Add ‘badges’ to these goals, and show them to the visitor, and you already have a very basic implementation of Gamification! Examples of goals:

  • Becoming an allround News Reader (reading 20+ articles in all categories)
  • Becoming an Expert News Reader in a certain field (Reading 100+ articles a certain category)
  • Sharing more than 30 articles on a social network
  • Etc…

News Progress Bars

The code that makes this possible is the following. I have specified two profile keys: foreign news and domestic news. (you could easily add more) These two are then rendered in a progress bar with a maximum of 1000 points. You could also choose to make this configurable as a Rendering Parameter for example.
The class NewsProfileFeedback is responsible for retrieving the data from the Analytics database, and is specified below.

protected void OnLoad(EventArgs e)
{
    string progressBarTemplate = "<meter value="{0}" max="1000" low="10" high="90"></meter>";

    NewsProfileFeedback newsProfileFeedback = new NewsProfileFeedback();

    double foreignNewsValue = newsProfileFeedback.GetProfileKeyValue("{5BE193AD-7ABE-4174-someguid--of-profilefield}");
    double domesticNewsValue = newsProfileFeedback.GetProfileKeyValue("{1ADEF9E0-33CF-4A6F-someguid--of-profilefield}");

    LiteralForeign.Text = string.Format(progressBarTemplate, foreignNewsValue.ToString());
    LiteralDomestic.Text = string.Format(progressBarTemplate, domesticNewsValue.ToString());

    base.OnLoad(e);
}

The NewsProfileFeedback class:

public class NewsProfileFeedback
{
    public double GetProfileKeyValue(string profileKeyId)
    {
        if (ID.IsID(profileKeyId))
        {
            Item profileKeyItem = Tracker.DefinitionDatabase.GetItem(profileKeyId);
            if (profileKeyItem != null)
            {
                Item parent = profileKeyItem.Parent;
                if (parent != null)
                {
                    string name1 = profileKeyItem.Name;
                    string name = parent.Name;
                    Tracker.Visitor.Load(new VisitorLoadOptions()
                    {
                        Start = Tracker.Visitor.GetOrCreateCurrentVisit().VisitorVisitIndex,
                        Count = 1,
                        VisitLoadOptions = VisitLoadOptions.Profiles,
                        Options = VisitorOptions.None
                    });

                    VisitorDataSet.ProfilesRow profilesRow = Tracker.CurrentVisit.Profiles.FirstOrDefault(row => string.Compare(row.ProfileName, name,
ngComparison.InvariantCultureIgnoreCase) == 0);

                    if (profilesRow != null)
                    {
                        return (double)profilesRow.GetValue(name1);
                    }
                }
            }
        }

        return 0.0;
    }
}
Advertisements