Tracking of Relatude forms submissions through Google analytics

If you want to track submissions from the Relatude forms module in Google Analytics you probably want to filter out the ones who’s valid and the ones that’s not.

If you want to track submissions from the Relatude forms module in Google Analytics you probably want to filter out the ones who’s valid and the ones that’s not.

To do this you have to make your own content class that inherits the native WebForm class. In the partial class you override the OnInvalid and the OnSubmit methods to send the desired page address to Google:

        public override void OnInvalid(System.Collections.Specialized.NameValueCollection values, System.Collections.Generic.Dictionary<string, string> invalidFields) {
            base.OnInvalid(values, invalidFields);
            WAFMetrics.PageView.Address = WAFContext.GetUrl(WAFContext.Request.NodeId) + "/form-" + this.NodeId.ToString() + "/invalid";
        }

        public override void OnSubmit(WAF.Engine.Content.Native.WebFormSubmit submit) {
            base.OnSubmit(submit);
            WAFMetrics.PageView.Address = WAFContext.GetUrl(WAFContext.Request.NodeId) + "/form-" + this.NodeId.ToString() + "/submitted";
        }