!function(a,i){"use strict";function o(t,n){this.forms=t,this.options=n;var r=this;this.track=function(t,n,e){var o=this.forms[t];void 0===o&&(console.error("Form #"+t+" not found"),"function"==typeof e)&&e(!1),this.gaLoad("event","send",{event_category:r.options.event_category,event_action:n,event_label:"Form #"+t+" - "+o.name,event_callback:function(){"function"==typeof e&&e(!0)},non_interaction:!0,send_to:r.options.tracking_id})},this.gaLoad=function(t,n,e){var o;function r(){dataLayer.push(arguments)}void 0!==r&&void 0!==a.dataLayer||((o=i.createElement("script")).async=!0,o.src="https://www.googletagmanager.com/gtag/js?id="+this.options.tracking_id,i.getElementsByTagName("head")[0].appendChild(o),a.dataLayer=a.dataLayer||[],r("js",new Date)),r("config",this.options.tracking_id),r(t,n,e)}}ConvertForms.Helper.onReady(function(){var t,e,n=ConvertForms.Helper.getOption("gatracker");n&&(t=n.forms,e=new o(t,n.options),Object.keys(t).forEach(function(n){i.querySelectorAll("#cf_"+n).forEach(function(t){e.track(n,"Load"),t.addEventListener("impression",function(t){e.track(n,"Impression")}),t.addEventListener("success",function(){e.track(n,"Conversion")}),t.addEventListener("error",function(){e.track(n,"Error")})})}),a.ConvertForms.GoogleAnalyticsTracker=e)})}(window,document);

