Brian McKeiver's Blog

How to Increase Subscribers on Your Kentico Website with Marketing Automation


In this quick How To guide, I will show how you can increase your subscriber count using the power of Marketing Automation via built-in Kentico functionality. The best part about this solution is that there is no custom code required. That's right, all you have to do is follow these simple steps to help generate more subscribers for your digital marketing efforts which should in turn get you more leads from your Kentico website.


The Solution

The core strategy here is to leverage Kentico's On-line Form engine, alongside its built-in Marketing Automation, Contact Management, and Activity Management ability. In this blog post I will be walking you through how to add a simple checkbox field to any on-line form, default its form control value to checked, and connect the actual form submission to transfer the contact's email address right to your Kentico newsletter as a subscriber automatically. The secret sauce here is actually the trigger of the marketing automation process that is involved. The solution is seamless to the user and should not detract anyone from filling out the form. We are simply adding a new checkbox at the bottom of the form to ask the visitor's permission to market to them at a later date.


Kentico 8 On-line Form with Opt-in



Step 1 - Enable the Correct Settings

This is a simple step, just make sure you check all the correct settings to on for your site. You want make sure that in Settings -> On-line Marketing -> Enable On-line Marketing, Settings -> On-line Marketing -> Web Analytics -> Enable Web Analytics, and Settings -> On-line Marketing -> Contact Management -> Activities -> Log Activities are all checked.




It is optional to turn on the other features on On-line marketing, but I would if you are going to use the full power of the integrated On-line Marketing solution that Kentico has. If you are not sure how to utilize them, drop me a line.



Step 2 - Create / Utilize an On-line Form with Opt In Checkbox

If you are running a Kentico website you probably have a Contact Us on-line form or other similar form. Good, because that is what you need for this example. What you might not have is an extra field that acts as an opt-in option for visitors who fill out that form. To do so you can easily leverage the Kentico form engine. Add another field to the form and make sure its data type is Boolean, default the value to checked (true) and name it something that you will remember because this name will become important later on. You can even give it a nice caption to let people know exactly what is going on.

For this blog post I am using the Kentico e-commerce starter site template. On that starter site there is already a Product Question on-line form, and that form is already on each single product page template towards the bottom of the page. If you are starting from scratch, just add the on-line form webpart to any portal page template and choose the proper on-line form now. I followed the instructions above and the result looks like this:


Kentico 8 On-line Form Add Opt-in Field


Pro Tip: Make sure that you have a Conversion applied in the on-line form webpart on the design tab of the page that shows this webpart. Set the conversion value also. This will allow use of Kentico Lead Scoring and Segmentation.


The last thing about the form itself is to make sure that you have the correct Contact mapping setup. To do so click the Contact mapping tab of the form. And make sure that the E-mail Address attribute is linked to the field of your form that asks the visitor for their email address. I also normally check the box at the top that says Overwrite existing contact information.


Kentico 8 On-line Form Contact mapping


That is it for the form. Again just make sure you drop it on a page that we can test with for this example.



Step 3 - Create a Marketing Automation Process

Now that we have a form with an opt-in checkbox, let's do something with it. Create a new marketing automaton process and name it something like Auto Subscribe to Newsletter. Also make sure that the Process Start setting is set to If it hasn't been run before under the Advanced section. This will prevent any attempt to subscribe the contact more than once.


Kentico 8 Marketing Automation Process


Click the Save button to save your work.



Step 4 - Create a Marketing Automation Trigger

This is a simple step to make sure that the Process kicks off whenever the correct action takes place in the system. In our example that means whenever someone submits the Product Question on-line form. To do so create a new Trigger, give it a Display name, set its Type to Activity Performed, set its Activity Type to Form Submission, and set its Condition to Activity 'Form Submission' was performed for form .
Kentico 8 Marketing Automation Process Trigger
The easiest way to do this is to click Edit on Condition attribute and then search for the word form in the macro condition chooser in the resulting modal that pops up. Select the Activity 'Form Submission' performed for form, and then click the left arrow button to get it to the left side of the modal. From here you can click on the word form (it is underlined) and an on-line form chooser appears. Your form should be in that list. If not something is wrong. It should look like this:
Kentico 8 Marketing Automation Process Trigger Macro
Save and close everything out.

Step 5 – Finish Designing the Marketing Automation Process

Now that we have the process created and have told Kentico when to trigger it, we need to finish what happens inside of the process. Click on Steps next. Once the visual designer loads up, drag on to the process design area a Condition step and a Newsletter Subscription step. Connect the workflow direction connectors and connect the Start step to the Condition step, and link each Condition connector to the remaining two steps (Newsletter Subscription and Finish). Make sure its the condition passed (true) connector that goes to the Newsletter step, and then finally link the Newsletter step to the Finished step.


Kentico 8 Marketing Automation Process Steps


Configure the properties of the Newsletter step by clicking the edit button on the title bar. Once the properties modal appears, select the Newsletter that you have on your Kentico site, and choose the Subscribe to Newsletter Action from the bottom of the properties modal window.

And now the only tricky part of the whole solution. Edit the Condition step and change the condition to match the following K# macro syntax:

i = Contact.LastActivity.ActivityItemDetailID; SiteContext.CurrentSite.DataContext.SiteObjects.Forms.Product_Question.Items.Where("ProductQuestionID = " + i)[0]["SubscribeMe"]

I know it is a bit of a crazy macro, but I promised you a no code solution right ? This single macro is the magic that ties all of this together. From the last activity that the contact did, it pulls the ActivityItemDetailID, which is the primary key of the on-line form data row that was just submitted. The macro then goes back to the data of the form and looks up the entire row to find the special opt-in field. In our case this is the SubscribeMe field. You might have to change that field in your macro to match, as well as the form name of Product_Question to match your form.

Once you have all the conditions set save and close everything. That's it.



The Results

Since we have the marketing automation setup it is now just a matter of filling out the form and clicking submit. Open up a new incognito browser window if you are using Chrome and navigate to that page that has your form. Submit the form and then wait up to one minute for the activity log to process and show up in your activity data. If you look at your subscriber count if should have just went up by one. Awesome.

In the screen shot below you can also see that the e-mail address is the contact’s e-mail and the subscriber name is the name of the contact. The form we were using doesn’t have fields for first and last name, and that is why the system fills in the anonymous stamp. If your form does have name fields don’t forget to map those too in the Contact mapping section of the on-line form and they will get transferred to the subscriber as well.


Kentico 8 Newsletter Subscriber count


Side note, the process still works even if you have your Kentico newsletter configured to use double opt-in confirmation. I was a little surprised by this fact, but it makes sense the more I thought about it. It would be nice if the built in Newsletter subscription action would trigger an activation email link instead, but you could always create a custom action to do this if you really wanted to.

Side note two, I promised a no code solution. However, as you might have guessed, the crazy Condition to look up the row of data that stores the opt-in checkbox is not the most efficient macro in the world, but it does work. If you are in a scenario where you have a large volume of users and a heavy website load you can easily switch it out to use a Trigger Event Handler. This article explains how you can add the correct code to pass the form submission data directly to the trigger and is actually a great way to do it.

Well that's it. I hope you see the power of marketing automation that Kentico has and how it can help you increase your newsletter subscriber count with very little work. Please leave any feedback or questions in the comments below. Thanks.