The conversion tracking allows you to track the behavior of visitors on your website and adjust the website for better results.
Tracking conversions in registration form, newsletter subscription and shopping cart
Kentico CMS comes with built-in support for tracking conversions in the following situations:
When the user registers, you can track it as a conversion by setting the value Track conversion name of the Registration form web part to some custom name - e.g. "registration".
When the user registers, you can track it as a conversion by setting the value Track conversion name of the Newsletter subscription web part to some custom name - e.g. "subscription".
Purchase in the shopping cart
When the user registers or makes a purchase, you can track it as a conversion by setting the value Registration conversion name or Order conversion name of the Shopping cart web part to some custom name - e.g. cart_registration or cart_order.
Tracking conversions and their campaign or referring websites
If you wish to track the conversion together with campaign name or referring URL, you need to use the conversion name in the following format (for example):
Tracking conversions using your custom code
Using your custom code, you can track a conversion when a visitor makes some action on your website, such as registration, sign up, etc. Then, you can see what changes made to the website helped you increase your conversion rate.
To track a conversion, you need to add a piece of code to your page, web part or to some global event handler:
string siteName = CMS.CMSHelper.CMSContext.CurrentSiteName;
&& !CMS.WebAnalytics.AnalyticsHelper.IsIPExcluded(siteName, HttpContext.Current.Request.UserHostAddress))
// log conversion, the conversion name is "order"
CMS.WebAnalytics.HitLogProvider.LogHit("conversion", siteName, null, "order", 0);
Then, the conversion is tracked and you can see the statistics in the Conversions report.
You may want to use the following properties of the current user that provide information on the website and/or campaign from which the user came:
CMSContext.CurrentUser.URLReferrer //website URL from which the visitor came
CMSContext.CurrentUser.Campaign //campaign from which the visitor came
// after the user registers, the information is available in the following database-stored values:
CMSContext.CurrentUser.UserURLReferrer //website URL from which the visitor first came
CMSContext.CurrentUser.UserCampaign //campaign from which the visitor first came