Google Analytics Contour Forms

 

Google Analytics allows you to measure when form buttons are clicked. To do this, you need to add code to the onclick event of buttons. However, Contour adds its own onclick code to buttons and adding Goggle's code via a jQuery onclick handler will not actually execute that code. The form submits prior to the jQuery onclick code being executed.

To get around this mess, add this in your pages PageLoad event

if(Request.Form["name of the button being clicked"].Length > 0)
//this means the form has been submitted
{
    Response.Write("javascript to insert Google code to measure when buttons are being clicked");
}
Share