Keeping your Online Marketing ecosystem healthy

Online Marketing in Kentico is a very powerful tool. However, with power comes great responsibility, so you should take care to keep your Kentico Online Marketing ecosystem healthy, especially on sites with high traffic. This article will show you some tips on how to achieve that.

So, what can you do to keep Online Marketing working smoothly in Kentico 8.1?

Use only fast macro rules

Convert all your custom macro rules into new macro rules. This is super important. Macro SQL translations were introduced in Kentico 8.1 with all the default macros already translated. If you have some custom macro rules in Online Marketing that are not translated into the SQL query yet, do it ASAP. This applies to hand-written macros as well—the ones written in the code tab of the macro rule designer. If you use these, you need to convert them first into custom macro rules, and then implement an SQL translator for it – this is definitely worth doing!
You don't ever want to see the warning illustrated below when editing a contact group; it means your macro will be evaluated for each contact separately, instead of just once for all contacts.


Don't overuse Marketing Automation

Marketing Automation is a strong tool that can be used for almost any process involving contacts. It is tempting to use it on the simplest of tasks, just because it's easy. But you should always consider whether there is a simpler way to achieve your goal. Every transition from step to step is being calculated and is not done in batches. Therefore, you should always use MA only for a continuous flow of contacts, not for batch operations
So, when should you use it and when should you not? Marketing Automation is not suited for mass updates, mass exports, other mass operations, or simple things that could be done in a different way. Marketing Automation is suited for advanced marketing purposes, like those explained in the following youtube video

Adjust the deletion of your inactive contacts

Over the course of time, your contact database can get pretty big. It will be filled with anonymous contacts that bounced off of your website immediately, and for each and every one of them, there are probably recalculation tasks being run. In the case of merged contacts, we save the history of all contact merges so that you can split them whenever you want. The history is saved in merged contacts that have a foreign key to the active/main contact. But this might not be your case; you may not need merged contacts at all. 
So how do you keep your database clean?

The delete conditions are important settings that conveniently enable you to keep your contact and activity database clean. We don't turn it on by default since we don't want you to lose any data that you may want to keep, but you should really adjust it to your needs. Just to make this point nice and clear, these text fields in the settings are added through conjunction, so each one of them must apply. You can write your own SQL WHERE condition, though.
If you enable this setting for the first time on an already large database, be prepared. The deletion process takes a while to complete.

Schedule recalculation only when necessary

We have redesigned the Contact Group recalculation scheduler a little in Kentico 8.1 – it now looks like this:

Most of the time, you don't even need to switch this on at all. How come? Kentico only recalculates a contact's membership when performing an activity that affects the contact group. This means that when a page visit activity is performed, contact groups that have page visit macros included will get recalculated almost immediately. Why did we put it there then? The problem arises when a piece of contextual information, most notably time, is included in the macro. Kentico doesn't know when to trigger the recalculation for each contact and a scheduled daily recalculation is needed. 
Which of our default macro rules need scheduled recalculation?
  • All of the ones that have "in the last X days"
  • Contact age is between/greater than
  • Contact is in role
  • Current date/day/month is X
  • Rules which contain NOT in the condition, such as “Contact has not opened email”
  • Contact is located in a specific contact group
If your contact group consists only of “Contact is male” and “Contact has done an activity”, you are safe to uncheck it. This will save you a complete recalculation once a day.
What about Kentico 8.0 and the previous versions? It’s even more important to recalculate only when necessary in previous versions. You should go through all your contact groups and turn the recalculation off wherever you can. The same rules as those stated above apply to this scenario.

Don't use global contacts when you don't need them

Do you have just one site on a Kentico instance? You don't need global contacts at all. Turn them off. Disabled global contacts can save some space too. You can enable automatic creation of global contacts later when you need to share contacts across multiple sites.

Tune activity logging on pages

Do you need page visits on all pages? A page visit is by far the most frequent activity of them all. Do you need to track it on all pages?

Turn off activities on the accounts of your administrators

Your administrators and editors definitely do a lot of activities. You can disable tracking even on a user basis. This article written by Vita Janecek neatly sums up all of the possible ways in which you can disable activity tracking.

Check for needless recalculations

Remove contact group/scoring and personas that are not needed anymore so that they don't get recalculated.

Make sure your recalculation scheduled tasks run off-peak

The recalculation task for a contact group is created to be run at a random time between 2 AM and 6 AM to ensure off-peak hours. That doesn't have to be your case, adjust it to your needs. You can do that in Scheduled tasks -> System tasks.

A few additional tips if you are on Kentico 8.0 or lower

  • Upgrade to Kentico 8.1, if you use any contact group, scoring or persona. Very important: All of the SQL macro rule translators are there.
  • Add the index ContactGroupMemberContactGroupID, ContactGroupMemberType, and ContactGroupMemberRelatedID to the ContactGroupMember table – this is an inexpensive change that improves the performance of contact group recalculation.
  • Disable the web.config key CMSLogActivitiesImmediatellyToDB. Skip this part if you haven't heard about that key. It decreases response time for all contacts, since everything gets recalculated synchronously in the request – we removed the key in Kentico 8.1 anyway.
And, that’s all! Your questions and feedback are always appreciated, so feel free to leave a comment below. Thanks for reading and see you next time!
Share this article on   LinkedIn